Skip to content

Commit 6d53a9f

Browse files
peilin-yeaxboe
authored andcommitted
block/scsi-ioctl: Fix kernel-infoleak in scsi_put_cdrom_generic_arg()
scsi_put_cdrom_generic_arg() is copying uninitialized stack memory to userspace, since the compiler may leave a 3-byte hole in the middle of `cgc32`. Fix it by adding a padding field to `struct compat_cdrom_generic_command`. Cc: [email protected] Fixes: f3ee6e6 ("compat_ioctl: move CDROM_SEND_PACKET handling into scsi") Suggested-by: Dan Carpenter <[email protected]> Suggested-by: Arnd Bergmann <[email protected]> Reported-by: [email protected] Signed-off-by: Peilin Ye <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 632bfb6 commit 6d53a9f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

block/scsi_ioctl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ struct compat_cdrom_generic_command {
651651
compat_int_t stat;
652652
compat_caddr_t sense;
653653
unsigned char data_direction;
654+
unsigned char pad[3];
654655
compat_int_t quiet;
655656
compat_int_t timeout;
656657
compat_caddr_t reserved[1];

0 commit comments

Comments
 (0)