yshigeru / linux-devel

Linux kernel source tree
Other
0 stars 0 forks source link

KMSAN: uninit-value in sr_check_events #14

Closed yshigeru closed 1 year ago

yshigeru commented 1 year ago
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000057bf8c
R13: 000000000000000b R14: 000000000057bf80 R15: 00007fa54de14000
 </TASK>
=====================================================
BUG: KMSAN: uninit-value in sr_get_events drivers/scsi/sr.c:180 [inline]
BUG: KMSAN: uninit-value in sr_check_events+0x365/0x1460 drivers/scsi/sr.c:218
 sr_get_events drivers/scsi/sr.c:180 [inline]
 sr_check_events+0x365/0x1460 drivers/scsi/sr.c:218
 cdrom_update_events drivers/cdrom/cdrom.c:1485 [inline]
 cdrom_check_events+0x66/0x170 drivers/cdrom/cdrom.c:1495
 sr_block_check_events+0xf2/0x130 drivers/scsi/sr.c:562
 disk_check_events+0xec/0x900 block/disk-events.c:193
 disk_clear_events block/disk-events.c:248 [inline]
 bdev_check_media_change+0x2ac/0x7e0 block/disk-events.c:279
 sr_block_open+0x15a/0x320 drivers/scsi/sr.c:497
 blkdev_get_whole+0xae/0x6d0 block/bdev.c:594
 blkdev_get_by_dev+0x518/0x1210 block/bdev.c:744
 blkdev_open+0x215/0x430 block/fops.c:493
 do_dentry_open+0xfbd/0x19a0 fs/open.c:920
 vfs_open+0x7b/0xa0 fs/open.c:1051
 do_open fs/namei.c:3560 [inline]
 path_openat+0x4a54/0x5b40 fs/namei.c:3715
 do_filp_open+0x24d/0x660 fs/namei.c:3742
 do_sys_openat2+0x1f0/0x910 fs/open.c:1348
 do_sys_open fs/open.c:1364 [inline]
 __do_sys_openat fs/open.c:1380 [inline]
 __se_sys_openat fs/open.c:1375 [inline]
 __x64_sys_openat+0x2b4/0x330 fs/open.c:1375
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Local variable sshdr.i created at:
 sr_get_events drivers/scsi/sr.c:172 [inline]
 sr_check_events+0x131/0x1460 drivers/scsi/sr.c:218
 cdrom_update_events drivers/cdrom/cdrom.c:1485 [inline]
 cdrom_check_events+0x66/0x170 drivers/cdrom/cdrom.c:1495

CPU: 1 PID: 13284 Comm: syz-executor.5 Not tainted 6.3.0-g81af97bdef5e-dirty #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.1-2.fc37 04/01/2014
=====================================================
yshigeru commented 1 year ago

repro.c.gz

yshigeru commented 1 year ago

Fixed on the latest kernel.