syzbot


KCSAN: data-race in file_update_time / inode_update_timestamps (2)

Status: moderation: reported on 2024/10/07 08:11
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+c27a4f864fd990610379@syzkaller.appspotmail.com
First crash: 44d, last: 12d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in file_update_time / inode_update_timestamps ext4 34 93d 292d 0/28 auto-obsoleted due to no activity on 2024/09/23 06:59

Sample crash report:
==================================================================
BUG: KCSAN: data-race in file_update_time / inode_update_timestamps

write to 0xffff888129ca7dfc of 4 bytes by task 21788 on cpu 0:
 inode_set_mtime_to_ts include/linux/fs.h:1644 [inline]
 inode_update_timestamps+0x166/0x280 fs/inode.c:2001
 generic_update_time fs/inode.c:2036 [inline]
 inode_update_time fs/inode.c:2056 [inline]
 __file_update_time fs/inode.c:2245 [inline]
 file_update_time+0x220/0x2b0 fs/inode.c:2275
 shmem_file_write_iter+0x99/0xe0 mm/shmem.c:3215
 iter_file_splice_write+0x5f1/0x980 fs/splice.c:743
 do_splice_from fs/splice.c:941 [inline]
 direct_splice_actor+0x160/0x2c0 fs/splice.c:1164
 splice_direct_to_actor+0x302/0x670 fs/splice.c:1108
 do_splice_direct_actor fs/splice.c:1207 [inline]
 do_splice_direct+0xd7/0x150 fs/splice.c:1233
 do_sendfile+0x39b/0x970 fs/read_write.c:1388
 __do_sys_sendfile64 fs/read_write.c:1455 [inline]
 __se_sys_sendfile64 fs/read_write.c:1441 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1441
 x64_sys_call+0xed5/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:41
 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

read to 0xffff888129ca7dfc of 4 bytes by task 21778 on cpu 1:
 inode_get_mtime_nsec include/linux/fs.h:1630 [inline]
 inode_get_mtime include/linux/fs.h:1636 [inline]
 inode_needs_update_time fs/inode.c:2224 [inline]
 file_update_time+0x92/0x2b0 fs/inode.c:2271
 fault_dirty_shared_page+0xde/0x340 mm/memory.c:3204
 do_shared_fault mm/memory.c:5389 [inline]
 do_fault mm/memory.c:5435 [inline]
 do_pte_missing mm/memory.c:3965 [inline]
 handle_pte_fault mm/memory.c:5766 [inline]
 __handle_mm_fault mm/memory.c:5909 [inline]
 handle_mm_fault+0x1370/0x2aa0 mm/memory.c:6077
 do_user_addr_fault arch/x86/mm/fault.c:1389 [inline]
 handle_page_fault arch/x86/mm/fault.c:1481 [inline]
 exc_page_fault+0x296/0x650 arch/x86/mm/fault.c:1539
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
 rep_movs_alternative+0x4a/0x70 arch/x86/lib/copy_user_64.S:65
 copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline]
 raw_copy_to_user arch/x86/include/asm/uaccess_64.h:147 [inline]
 copy_to_user_iter lib/iov_iter.c:25 [inline]
 iterate_ubuf include/linux/iov_iter.h:30 [inline]
 iterate_and_advance2 include/linux/iov_iter.h:300 [inline]
 iterate_and_advance include/linux/iov_iter.h:328 [inline]
 _copy_to_iter+0x141/0xd00 lib/iov_iter.c:185
 copy_to_iter include/linux/uio.h:211 [inline]
 get_random_bytes_user+0x112/0x260 drivers/char/random.c:472
 __do_sys_getrandom drivers/char/random.c:1414 [inline]
 __se_sys_getrandom drivers/char/random.c:1388 [inline]
 __x64_sys_getrandom+0xb5/0x190 drivers/char/random.c:1388
 x64_sys_call+0x2887/0x2d60 arch/x86/include/generated/asm/syscalls_64.h:319
 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: 0x04d63581 -> 0x056ecc01

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 21778 Comm: syz.4.5283 Not tainted 6.12.0-rc6-syzkaller-00169-g906bd684e4b1 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
==================================================================

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/08 11:47 upstream 906bd684e4b1 179b040e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_update_timestamps
2024/11/07 19:35 upstream ff7afaeca1a1 867e44df .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_update_timestamps
2024/10/18 07:05 upstream 6efbea77b390 666f77ed .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_update_timestamps
2024/10/08 18:16 upstream 87d6aab2389e 402f1df0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_update_timestamps
2024/10/08 02:58 upstream 87d6aab2389e d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_update_timestamps
2024/10/08 02:55 upstream 87d6aab2389e d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_update_timestamps
2024/10/07 08:10 upstream 8cf0b93919e1 d7906eff .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_update_timestamps
* Struck through repros no longer work on HEAD.