[moderation] [fs?] KCSAN: data-race in file_update_time / inode_set_ctime_current (2)

0 views
Skip to first unread message

syzbot

unread,
Nov 20, 2024, 1:16:25 PM (13 hours ago) Nov 20
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: bf9aa14fc523 Merge tag 'timers-core-2024-11-18' of git://g..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=16c0cb78580000
kernel config: https://syzkaller.appspot.com/x/.config?x=a4239a0e02e161ec
dashboard link: https://syzkaller.appspot.com/bug?extid=fa7830e2bd2e47fd3101
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [bra...@kernel.org ja...@suse.cz linux-...@vger.kernel.org linux-...@vger.kernel.org vi...@zeniv.linux.org.uk]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/5889d7019bad/disk-bf9aa14f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8d0c07d02151/vmlinux-bf9aa14f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bafa60632b80/bzImage-bf9aa14f.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+fa7830...@syzkaller.appspotmail.com

==================================================================
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
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages