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: stable@vger.kernel.org Fixes: f3ee6e6 ("compat_ioctl: move CDROM_SEND_PACKET handling into scsi") Suggested-by: Dan Carpenter <dan.carpenter@oracle.com> Suggested-by: Arnd Bergmann <arnd@arndb.de> Reported-by: syzbot+85433a479a646a064ab3@syzkaller.appspotmail.com Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 632bfb6 commit 6d53a9f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)