syzbot


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

Status: moderation: reported on 2024/11/20 18:16
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+fa7830e2bd2e47fd3101@syzkaller.appspotmail.com
First crash: 12h16m, last: 12h16m
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KCSAN: data-race in file_update_time / inode_set_ctime_current ext4 1 201d 201d 0/28 auto-obsoleted due to no activity on 2024/06/07 07:08

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

read to 0xffff8881183d66b0 of 8 bytes by task 14640 on cpu 1:
 inode_get_ctime_sec include/linux/fs.h:1673 [inline]
 inode_get_ctime include/linux/fs.h:1683 [inline]
 inode_needs_update_time fs/inode.c:2337 [inline]
 file_update_time+0xce/0x2b0 fs/inode.c:2380
 shmem_file_write_iter+0x99/0xe0 mm/shmem.c:3266
 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+0x398/0x660 fs/read_write.c:1363
 __do_sys_sendfile64 fs/read_write.c:1424 [inline]
 __se_sys_sendfile64 fs/read_write.c:1410 [inline]
 __x64_sys_sendfile64+0x110/0x150 fs/read_write.c:1410
 x64_sys_call+0xfbd/0x2dc0 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

write to 0xffff8881183d66b0 of 8 bytes by task 14637 on cpu 0:
 inode_set_ctime_current+0x4ea/0x7a0 fs/inode.c:2812
 inode_update_timestamps+0x85/0x250 fs/inode.c:2067
 generic_update_time fs/inode.c:2106 [inline]
 inode_update_time fs/inode.c:2126 [inline]
 __file_update_time fs/inode.c:2354 [inline]
 file_update_time+0x219/0x2b0 fs/inode.c:2384
 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+0x118a/0x2dc0 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: 0x00000000673e295d -> 0x00000000673e295e

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 14637 Comm: syz.3.3824 Not tainted 6.12.0-syzkaller-01782-gbf9aa14fc523 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/11/20 18:16 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in file_update_time / inode_set_ctime_current
* Struck through repros no longer work on HEAD.