syzbot


KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr (2)

Status: auto-closed as invalid on 2021/10/28 10:08
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 501d, last: 439d
similar bugs (3):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr (3) 1 373d 373d 0/24 auto-closed as invalid on 2022/01/02 06:59
upstream KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr (4) 1 267d 267d 0/24 auto-closed as invalid on 2022/04/17 18:38
upstream KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr 2 549d 554d 0/24 auto-closed as invalid on 2021/07/10 05:40

Sample crash report:
loop5: detected capacity change from 0 to 212992
==================================================================
BUG: KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr

write to 0xffff888132432320 of 8 bytes by task 1337 on cpu 0:
 shmem_add_to_page_cache+0x53d/0x660 mm/shmem.c:743
 shmem_getpage_gfp+0xba5/0x13d0 mm/shmem.c:1935
 shmem_getpage mm/shmem.c:151 [inline]
 shmem_file_read_iter+0x1b2/0x5d0 mm/shmem.c:2546
 call_read_iter include/linux/fs.h:2157 [inline]
 do_iter_readv_writev+0x2fb/0x380 fs/read_write.c:727
 do_iter_read+0x192/0x5d0 fs/read_write.c:790
 vfs_iter_read+0x4c/0x70 fs/read_write.c:832
 lo_read_simple drivers/block/loop.c:404 [inline]
 do_req_filebacked drivers/block/loop.c:675 [inline]
 loop_handle_cmd drivers/block/loop.c:2201 [inline]
 loop_process_work+0x11ae/0x18f0 drivers/block/loop.c:2241
 loop_rootcg_workfn+0x1b/0x20 drivers/block/loop.c:2272
 process_one_work+0x402/0x910 kernel/workqueue.c:2297
 worker_thread+0x636/0xae0 kernel/workqueue.c:2444
 kthread+0x262/0x280 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30

read to 0xffff888132432320 of 8 bytes by task 28880 on cpu 1:
 shmem_getattr+0x71/0x260 mm/shmem.c:1070
 vfs_getattr_nosec+0x153/0x2f0 fs/stat.c:123
 vfs_getattr+0x4d/0x60 fs/stat.c:160
 loop_get_status+0x261/0x330 drivers/block/loop.c:1613
 loop_get_status64 drivers/block/loop.c:1721 [inline]
 lo_ioctl+0x1eb/0x13e0 drivers/block/loop.c:1866
 blkdev_ioctl+0x1d0/0x3f0 block/ioctl.c:589
 block_ioctl+0x6e/0x80 block/fops.c:477
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xcb/0x140 fs/ioctl.c:860
 __x64_sys_ioctl+0x3f/0x50 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x44/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae

value changed: 0x0000000000000003 -> 0x0000000000000004

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 28880 Comm: syz-executor.5 Not tainted 5.15.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
==================================================================

Crashes (4):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-kcsan-gce 2021/09/23 10:00 upstream 58e2cf5d7946 8cac236e .config log report info KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
ci2-upstream-kcsan-gce 2021/09/08 03:10 upstream 0bcfe68b8767 064c9eb7 .config log report info KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
ci2-upstream-kcsan-gce 2021/08/17 12:12 upstream a2824f19e606 33c26cb7 .config log report info KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
ci2-upstream-kcsan-gce 2021/07/23 12:53 upstream 9bead1b58c4c bc5f1d88 .config log report info KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
* Struck through repros no longer work on HEAD.