syzbot


KCSAN: data-race in lo_ioctl / loop_queue_rq (3)

Status: auto-closed as invalid on 2022/08/20 11:36
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 140d, last: 140d
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in lo_ioctl / loop_queue_rq (2) 1 586d 585d 0/24 auto-closed as invalid on 2021/05/31 09:44
upstream KCSAN: data-race in lo_ioctl / loop_queue_rq 1 1088d 1088d 0/24 auto-closed as invalid on 2020/02/19 07:26

Sample crash report:
I/O error, dev loop0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop0, logical block 0, async page read
==================================================================
BUG: KCSAN: data-race in lo_ioctl / loop_queue_rq

write to 0xffff888101f00878 of 4 bytes by task 25545 on cpu 0:
 loop_clr_fd drivers/block/loop.c:1249 [inline]
 lo_ioctl+0xd63/0x1290 drivers/block/loop.c:1558
 blkdev_ioctl+0x20e/0x440 block/ioctl.c:614
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:856
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff888101f00878 of 4 bytes by task 1441 on cpu 1:
 loop_queue_rq+0x4b/0x650 drivers/block/loop.c:1806
 __blk_mq_issue_directly+0x66/0x410 block/blk-mq.c:2457
 __blk_mq_try_issue_directly+0x25d/0x2c0 block/blk-mq.c:2510
 blk_mq_try_issue_directly block/blk-mq.c:2534 [inline]
 blk_mq_submit_bio+0xaef/0xe50 block/blk-mq.c:2850
 __submit_bio block/blk-core.c:648 [inline]
 __submit_bio_noacct_mq block/blk-core.c:725 [inline]
 submit_bio_noacct_nocheck+0x83d/0xaa0 block/blk-core.c:742
 submit_bio_noacct+0x690/0x7f0 block/blk-core.c:849
 submit_bio+0xfb/0x110
 submit_bh_wbc+0x2a8/0x2f0 fs/buffer.c:3039
 submit_bh fs/buffer.c:3045 [inline]
 block_read_full_folio+0x4d6/0x560 fs/buffer.c:2337
 blkdev_read_folio+0x18/0x20 block/fops.c:377
 do_read_cache_folio+0x20f/0x3a0 mm/filemap.c:3524
 do_read_cache_page mm/filemap.c:3602 [inline]
 read_cache_page+0x37/0x170 mm/filemap.c:3611
 read_mapping_page include/linux/pagemap.h:759 [inline]
 read_part_sector+0x78/0x2f0 block/partitions/core.c:715
 msdos_partition+0xa5/0x1740 block/partitions/msdos.c:592
 check_partition block/partitions/core.c:147 [inline]
 blk_add_partitions block/partitions/core.c:600 [inline]
 bdev_disk_changed+0x40d/0xc30 block/partitions/core.c:686
 blkdev_get_whole block/bdev.c:686 [inline]
 blkdev_get_by_dev+0x3c0/0x9c0 block/bdev.c:823
 blkdev_open+0xac/0x140 block/fops.c:481
 do_dentry_open+0x521/0x850 fs/open.c:848
 vfs_open+0x43/0x50 fs/open.c:981
 do_open fs/namei.c:3520 [inline]
 path_openat+0x16cf/0x1b30 fs/namei.c:3653
 do_filp_open+0x105/0x220 fs/namei.c:3680
 do_sys_openat2+0xb5/0x2a0 fs/open.c:1278
 do_sys_open fs/open.c:1294 [inline]
 __do_sys_openat fs/open.c:1310 [inline]
 __se_sys_openat fs/open.c:1305 [inline]
 __x64_sys_openat+0xef/0x110 fs/open.c:1305
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0x00000001 -> 0x00000002

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 1441 Comm: udevd Not tainted 5.19.0-rc6-syzkaller-00364-g9b59ec8d50a1-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/29/2022
==================================================================
I/O error, dev loop0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop0, logical block 0, async page read
 loop0: unable to read partition table
I/O error, dev loop3, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop3, logical block 0, async page read
 loop3: unable to read partition table
loop3: partition table beyond EOD, truncated
I/O error, dev loop4, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop4, logical block 0, async page read
I/O error, dev loop4, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop4, logical block 0, async page read
 loop4: unable to read partition table
I/O error, dev loop0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop0, logical block 0, async page read
I/O error, dev loop0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop0, logical block 0, async page read
 loop0: unable to read partition table
I/O error, dev loop3, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
Buffer I/O error on dev loop3, logical block 0, async page read

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/07/16 11:32 upstream 9b59ec8d50a1 95cb00d1 .config log report info KCSAN: data-race in lo_ioctl / loop_queue_rq
* Struck through repros no longer work on HEAD.