syzbot


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

Status: moderation: reported on 2024/07/05 14:13
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+001e0f4dc8703945a00f@syzkaller.appspotmail.com
First crash: 92d, last: 1d20h
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr (2) mm 4 1108d 1170d 0/28 auto-closed as invalid on 2021/10/28 10:08
upstream KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr (3) mm 1 1042d 1042d 0/28 auto-closed as invalid on 2022/01/02 06:59
upstream KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr (4) mm 1 936d 936d 0/28 auto-closed as invalid on 2022/04/17 18:38
upstream KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr mm 2 1218d 1223d 0/28 auto-closed as invalid on 2021/07/10 05:40

Sample crash report:
==================================================================
BUG: KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr

read-write to 0xffff8881146aa528 of 8 bytes by task 12655 on cpu 1:
 shmem_add_to_page_cache+0x3b9/0x4b0 mm/shmem.c:820
 shmem_alloc_and_add_folio mm/shmem.c:1839 [inline]
 shmem_get_folio_gfp+0x4f6/0xd90 mm/shmem.c:2335
 shmem_get_folio mm/shmem.c:2441 [inline]
 shmem_write_begin+0xa2/0x180 mm/shmem.c:3046
 generic_perform_write+0x1a8/0x4a0 mm/filemap.c:4054
 shmem_file_write_iter+0xc2/0xe0 mm/shmem.c:3221
 __kernel_write_iter+0x24b/0x4e0 fs/read_write.c:616
 dump_emit_page fs/coredump.c:884 [inline]
 dump_user_range+0x3a7/0x550 fs/coredump.c:945
 elf_core_dump+0x1b66/0x1c60 fs/binfmt_elf.c:2121
 do_coredump+0x1736/0x1ce0 fs/coredump.c:758
 get_signal+0xdc0/0x1070 kernel/signal.c:2902
 arch_do_signal_or_restart+0x95/0x4b0 arch/x86/kernel/signal.c:337
 exit_to_user_mode_loop kernel/entry/common.c:111 [inline]
 exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline]
 irqentry_exit_to_user_mode+0x9a/0x130 kernel/entry/common.c:231
 irqentry_exit+0x12/0x50 kernel/entry/common.c:334
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623

read to 0xffff8881146aa528 of 8 bytes by task 11923 on cpu 0:
 shmem_getattr+0x69/0x200 mm/shmem.c:1157
 vfs_getattr_nosec fs/stat.c:166 [inline]
 vfs_getattr+0x19b/0x1e0 fs/stat.c:207
 vfs_statx_path fs/stat.c:251 [inline]
 vfs_statx+0x134/0x2f0 fs/stat.c:315
 vfs_fstatat+0xec/0x110 fs/stat.c:341
 __do_sys_newfstatat fs/stat.c:505 [inline]
 __se_sys_newfstatat+0x58/0x260 fs/stat.c:499
 __x64_sys_newfstatat+0x55/0x70 fs/stat.c:499
 x64_sys_call+0x141f/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:263
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xc9/0x1c0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0x00000000000003c6 -> 0x00000000000003c9

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 11923 Comm: syz-executor Not tainted 6.12.0-rc1-syzkaller-00046-g7ec462100ef9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================
EXT4-fs (loop1): unmounting filesystem 76b65be2-f6da-4727-8c75-0525a5b65a09.

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/10/03 19:46 upstream 7ec462100ef9 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/10/03 06:34 upstream f23aa4c0761a a4c7fd36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/09/12 21:37 upstream 77f587896757 60e1a995 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/09/01 20:50 upstream 431c1646e1f8 1eda0d14 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/08/24 11:50 upstream 60f0560f53e3 d7d32352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/08/15 22:09 upstream 1fb918967b56 e4bacdaf .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/08/11 12:30 upstream 5189dafa4cf9 6f4edef4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/08/07 02:19 upstream eb5e56d14912 1ef9fe42 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/08/03 13:16 upstream 17712b7ea075 1786a2a8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/07/28 05:12 upstream ff30564411ff 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/07/26 20:30 upstream 2f8c4f506285 46eb10b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/07/22 20:58 upstream 933069701c1b df655b64 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/07/18 22:09 upstream b1bc554e009e 71884c12 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/07/15 14:33 upstream 0c3836482481 c605e6a2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
2024/07/05 14:13 upstream 661e504db04c 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in shmem_add_to_page_cache / shmem_getattr
* Struck through repros no longer work on HEAD.