Skip to contentSkip to conversation

include/scsi/scsi.h: type mismatch in userspace

PATCH [email protected] 1 participant 2 messages Jan 26, 2010 – Feb 18, 2010 2 messages not in the archive SCSI

lore
Share & tools
lore
#2 lore raw
In reply to a message not in the archive

Hello.

I think that there is mistake in linux/2.6.32.4/include/scsi/scsi.h:

the type defination of u8 should be type of __u8 on userspace (struct scsi_varlen_cdb_hdr).
I founded this problem when I try compile the util-linux-ng-2.17. This should cause problems many other packages also that includes scsi.h

Quoted 8 lines

Please let the Linux SCSI developers know about this, they are the ones responsible for fixing it. Once they have done so in the upstream tree, can I add it to the -stable tree.

thanks,

greg k-h

Best regards: Kristian Rainio <[email protected]>

Patch by Kristian Rainio
Little fix.

include/scsi/scsi.h renamed from include/scsi/scsi.h.orig +4 -4
@@ -145,10 +145,10 @@
 
 /* defined in T10 SCSI Primary Commands-2 (SPC2) */
 struct scsi_varlen_cdb_hdr {
-	u8 opcode;        /* opcode always == VARIABLE_LENGTH_CMD */
-	u8 control;
-	u8 misc[5];
-	u8 additional_cdb_length;         /* total cdb length - 8 */
+	__u8 opcode;        /* opcode always == VARIABLE_LENGTH_CMD */
+	__u8 control;
+	__u8 misc[5];
+	__u8 additional_cdb_length;         /* total cdb length - 8 */
 	__be16 service_action;
 	/* service specific data follows */
 };
#3 lore raw
In reply to a message not in the archive

Hello.

I think that there is mistake in linux/2.6.32.4/include/scsi/scsi.h:

the type defination of u8 should be type of __u8 on userspace (struct scsi_varlen_cdb_hdr).
I founded this problem when I try compile the util-linux-ng-2.17. This should cause problems many other packages also that includes scsi.h

Quoted 8 lines

Please let the Linux SCSI developers know about this, they are the ones responsible for fixing it. Once they have done so in the upstream tree, can I add it to the -stable tree.

thanks,

greg k-h

Best regards: Kristian Rainio <[email protected]>

Patch by Kristian Rainio
Little fix.

include/scsi/scsi.h renamed from include/scsi/scsi.h.orig +4 -4
@@ -145,10 +145,10 @@
 
 /* defined in T10 SCSI Primary Commands-2 (SPC2) */
 struct scsi_varlen_cdb_hdr {
-	u8 opcode;        /* opcode always == VARIABLE_LENGTH_CMD */
-	u8 control;
-	u8 misc[5];
-	u8 additional_cdb_length;         /* total cdb length - 8 */
+	__u8 opcode;        /* opcode always == VARIABLE_LENGTH_CMD */
+	__u8 control;
+	__u8 misc[5];
+	__u8 additional_cdb_length;         /* total cdb length - 8 */
 	__be16 service_action;
 	/* service specific data follows */
 };