Skip to content

Commit 4e80eef

Browse files
kirylmartinkpetersen
authored andcommitted
scsi: sg: Fix get_user() in call sg_scsi_ioctl()
get_user() expects the pointer to be pointer-to-simple-variable type, but sic->data is array of 'unsigned char'. It violates get_user() contracts. Explicitly take pointer to the first element of the array. It matches current behaviour. This is preparation for fixing sparse warnings caused by Linear Address Masking patchset. Signed-off-by: Kirill A. Shutemov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: "James E.J. Bottomley" <[email protected]> Cc: "Martin K. Petersen" <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 76dc609 commit 4e80eef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/scsi_ioctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ static int sg_scsi_ioctl(struct request_queue *q, fmode_t mode,
519519
return -EFAULT;
520520
if (in_len > PAGE_SIZE || out_len > PAGE_SIZE)
521521
return -EINVAL;
522-
if (get_user(opcode, sic->data))
522+
if (get_user(opcode, &sic->data[0]))
523523
return -EFAULT;
524524

525525
bytes = max(in_len, out_len);

0 commit comments

Comments
 (0)