syzbot


KCSAN: data-race in do_mpage_readpage / invalidate_disk

Status: auto-closed as invalid on 2022/05/17 07:31
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 239d, last: 239d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in do_mpage_readpage / invalidate_disk

write to 0xffff888101ba4498 of 8 bytes by task 7489 on cpu 0:
 i_size_write include/linux/fs.h:878 [inline]
 set_capacity block/genhd.c:63 [inline]
 invalidate_disk+0x86/0xb0 block/genhd.c:678
 __loop_clr_fd+0x3f5/0x640 drivers/block/loop.c:1147
 loop_clr_fd drivers/block/loop.c:1230 [inline]
 lo_ioctl+0xa12/0x11b0 drivers/block/loop.c:1556
 blkdev_ioctl+0x20e/0x440 block/ioctl.c:588
 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+0x44/0xae

read to 0xffff888101ba4498 of 8 bytes by task 1810 on cpu 1:
 i_size_read include/linux/fs.h:856 [inline]
 do_mpage_readpage+0x179/0xf20 fs/mpage.c:163
 mpage_readahead+0x18b/0x3f0 fs/mpage.c:356
 blkdev_readahead+0x18/0x20 block/fops.c:397
 read_pages+0xa0/0x7c0 mm/readahead.c:157
 page_cache_ra_unbounded+0x2a8/0x2e0 mm/readahead.c:261
 do_page_cache_ra mm/readahead.c:291 [inline]
 force_page_cache_ra+0x1c6/0x200 mm/readahead.c:322
 page_cache_sync_ra+0x190/0x1b0 mm/readahead.c:688
 page_cache_sync_readahead include/linux/pagemap.h:1185 [inline]
 filemap_get_pages mm/filemap.c:2598 [inline]
 filemap_read+0x3e5/0x1400 mm/filemap.c:2685
 blkdev_read_iter+0x2c6/0x370 block/fops.c:611
 call_read_iter include/linux/fs.h:2044 [inline]
 new_sync_read fs/read_write.c:401 [inline]
 vfs_read+0x5a5/0x6a0 fs/read_write.c:482
 ksys_read+0xe8/0x1a0 fs/read_write.c:620
 __do_sys_read fs/read_write.c:630 [inline]
 __se_sys_read fs/read_write.c:628 [inline]
 __x64_sys_read+0x3e/0x50 fs/read_write.c:628
 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+0x44/0xae

value changed: 0x0000000008100000 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 1810 Comm: udevd Not tainted 5.18.0-rc2-syzkaller-dirty #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================
blk_print_req_error: 24 callbacks suppressed
I/O error, dev loop4, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
I/O error, dev loop4, sector 0 op 0x0:(READ) flags 0x80700 phys_seg 1 prio class 0
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 0x80700 phys_seg 1 prio class 0
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 0x80700 phys_seg 1 prio class 0
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

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2022/04/12 07:30 upstream ce522ba9ef7e af01ee7d .config log report info KCSAN: data-race in do_mpage_readpage / invalidate_disk
* Struck through repros no longer work on HEAD.