[moderation] [kernel?] KCSAN: data-race in mm_update_next_owner / mm_update_next_owner

0 views
Skip to first unread message

syzbot

unread,
7:02 PM (1 hour ago) 7:02 PM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8dac6df92a2e Merge tag 'nfsd-7.4-1' of git://git.kernel.or..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1170d34d580000
kernel config: https://syzkaller.appspot.com/x/.config?x=886d2ddd2d6b664e
dashboard link: https://syzkaller.appspot.com/bug?extid=d65e830b5c4345957d51
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
CC: [linux-...@vger.kernel.org lu...@kernel.org pet...@infradead.org tg...@kernel.org]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/dfc787d10469/disk-8dac6df9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/db7a8e4799da/vmlinux-8dac6df9.xz
kernel image: https://storage.googleapis.com/syzbot-assets/169073a123bc/bzImage-8dac6df9.xz

AI-generated root cause summary:
During process teardown (e.g. exit_group) with multiple threads, concurrent
exiting threads invoke exit_mm() -> mm_update_next_owner(). The current owner
thread updates mm->owner using WRITE_ONCE(mm->owner, tsk) in
__try_to_set_owner(), while another exiting thread concurrently checks if it is
the owner via the lockless, unmarked read 'if (mm->owner != p)' in
mm_update_next_owner(). Because the read at kernel/exit.c:497 is not marked with
READ_ONCE (or rcu_access_pointer), KCSAN flags a data race between the marked
write and the unmarked read.

full analysis: https://syzkaller.appspot.com/x/ai_root_cause?x=d65e830b5c4345957d51

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

==================================================================
BUG: KCSAN: data-race in mm_update_next_owner / mm_update_next_owner

write (marked) to 0xffff8881043805f8 of 8 bytes by task 2218 on cpu 1:
__try_to_set_owner kernel/exit.c:462 [inline]
try_to_set_owner kernel/exit.c:477 [inline]
mm_update_next_owner+0x504/0x570 kernel/exit.c:-1
exit_mm+0x125/0x1d0 kernel/exit.c:585
do_exit+0x44a/0x1530 kernel/exit.c:967
do_group_exit+0xfe/0x140 kernel/exit.c:1123
get_signal+0xc49/0xd30 kernel/signal.c:3113
arch_do_signal_or_restart+0x96/0x480 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:66 [inline]
exit_to_user_mode_loop+0x161/0x940 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:343 [inline]
do_syscall_64+0x23b/0x3a0 arch/x86/entry/syscall_64.c:107
entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff8881043805f8 of 8 bytes by task 2225 on cpu 0:
mm_update_next_owner+0x2e/0x570 kernel/exit.c:497
exit_mm+0x125/0x1d0 kernel/exit.c:585
do_exit+0x44a/0x1530 kernel/exit.c:967
do_group_exit+0xfe/0x140 kernel/exit.c:1123
get_signal+0xc49/0xd30 kernel/signal.c:3113
arch_do_signal_or_restart+0x96/0x480 arch/x86/kernel/signal.c:337
__exit_to_user_mode_loop kernel/entry/common.c:66 [inline]
exit_to_user_mode_loop+0x161/0x940 kernel/entry/common.c:101
__exit_to_user_mode_prepare include/linux/irq-entry-common.h:207 [inline]
syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:230 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:343 [inline]
do_syscall_64+0x23b/0x3a0 arch/x86/entry/syscall_64.c:107
entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0xffff888100ba5640 -> 0xffff88812843b3c0

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 UID: 0 PID: 2225 Comm: syz.2.5181 Not tainted syzkaller #0 PREEMPT(lazy)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
==================================================================


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