syzbot


KCSAN: data-race in bdev_set_nr_sectors / block_read_full_folio

Status: auto-obsoleted due to no activity on 2024/01/09 22:45
Subsystems: block
[Documentation on labels]
Reported-by: syzbot+9afba386f14b01b1a40c@syzkaller.appspotmail.com
First crash: 437d, last: 437d

Sample crash report:
BUG: KCSAN: data-race in bdev_set_nr_sectors / block_read_full_folio

write to 0xffff8881006316b0 of 8 bytes by task 8705 on cpu 0:
 i_size_write include/linux/fs.h:932 [inline]
 bdev_set_nr_sectors+0x42/0x70 block/bdev.c:421
 set_capacity block/genhd.c:61 [inline]
 set_capacity_and_notify+0x6e/0x170 block/genhd.c:74
 loop_set_size+0x2e/0x70 drivers/block/loop.c:237
 loop_configure+0xaf9/0xca0 drivers/block/loop.c:1100
 lo_ioctl+0x682/0x12e0
 blkdev_ioctl+0x375/0x460 block/ioctl.c:633
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:871 [inline]
 __se_sys_ioctl+0xcf/0x140 fs/ioctl.c:857
 __x64_sys_ioctl+0x43/0x50 fs/ioctl.c:857
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

read to 0xffff8881006316b0 of 8 bytes by task 23252 on cpu 1:
 i_size_read include/linux/fs.h:910 [inline]
 block_read_full_folio+0x71/0x710 fs/buffer.c:2371
 blkdev_read_folio+0x1c/0x20 block/fops.c:420
 filemap_read_folio mm/filemap.c:2323 [inline]
 filemap_update_page mm/filemap.c:2407 [inline]
 filemap_get_pages+0xcfd/0xf90 mm/filemap.c:2521
 filemap_read+0x214/0x680 mm/filemap.c:2593
 blkdev_read_iter+0x217/0x2c0 block/fops.c:742
 call_read_iter include/linux/fs.h:2014 [inline]
 new_sync_read fs/read_write.c:389 [inline]
 vfs_read+0x3c0/0x590 fs/read_write.c:470
 ksys_read+0xeb/0x1a0 fs/read_write.c:613
 __do_sys_read fs/read_write.c:623 [inline]
 __se_sys_read fs/read_write.c:621 [inline]
 __x64_sys_read+0x42/0x50 fs/read_write.c:621
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x44/0x110 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x63/0x6b

value changed: 0x0000000000000000 -> 0x000000000005f800

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 23252 Comm: udevd Not tainted 6.7.0-rc4-syzkaller-00009-gbee0e7762ad2 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
==================================================================
I/O error, dev loop3, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 2

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/12/05 22:45 upstream bee0e7762ad2 858d62d1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in bdev_set_nr_sectors / block_read_full_folio
* Struck through repros no longer work on HEAD.