[moderation] [fs?] KCSAN: data-race in __d_drop / fast_dput (4)

0 views
Skip to first unread message

syzbot

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

syzbot found the following issue on:

HEAD commit: 666539eecdf4 Merge tag 'assoc-array-fixes-v2'
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11bbbbed580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b949a9d3c1d44ceb
dashboard link: https://syzkaller.appspot.com/bug?extid=018da129184660eb882f
compiler: Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
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/a943b9915869/disk-666539ee.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/9bfd839d7ea5/vmlinux-666539ee.xz
kernel image: https://storage.googleapis.com/syzbot-assets/0f20b9720a71/bzImage-666539ee.xz

AI-generated root cause summary:
A data race occurs between __d_drop() writing NULL to dentry->d_hash.pprev
during dentry eviction and fast_dput() reading dentry->d_hash.pprev via
d_unhashed() -> hlist_bl_unhashed() in retain_dentry(). In fast_dput(),
retain_dentry(dentry, false) intentionally checks dentry hash status locklessly
under rcu_read_lock() after atomically decrementing the lockref counter to zero.
If another task concurrently looks up the negative dentry, drops it, and invokes
dentry_kill() -> __d_drop(), the store to pprev races with the read because
hlist_bl_unhashed() and __d_drop() lack READ_ONCE()/WRITE_ONCE() annotations.
Both outcomes of the boolean check are safely tolerated by the lockless
fast_dput() logic without causing memory corruption or refcount inconsistencies.

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

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

==================================================================
BUG: KCSAN: data-race in __d_drop / fast_dput

write to 0xffff888105c6c9d0 of 8 bytes by task 2977 on cpu 0:
__d_drop+0x138/0x230 fs/dcache.c:609
dentry_kill+0x119/0x4f0 fs/dcache.c:855
finish_dput+0x16/0x1d0 fs/dcache.c:1032
dput+0x43/0x50 fs/dcache.c:1073
lookup_one_qstr_excl+0x156/0x240 fs/namei.c:-1
__start_dirop fs/namei.c:2926 [inline]
start_dirop fs/namei.c:2948 [inline]
filename_unlinkat+0x146/0x400 fs/namei.c:5718
__do_sys_unlink fs/namei.c:5772 [inline]
__se_sys_unlink+0x2b/0xe0 fs/namei.c:5769
__x64_sys_unlink+0x1f/0x30 fs/namei.c:5769
x64_sys_call+0x18ee/0x2550 arch/x86/include/generated/asm/syscalls_64.h:88
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x11e/0x3a0 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffff888105c6c9d0 of 8 bytes by task 5148 on cpu 1:
hlist_bl_unhashed include/linux/list_bl.h:54 [inline]
d_unhashed include/linux/dcache.h:402 [inline]
retain_dentry fs/dcache.c:903 [inline]
fast_dput+0x64/0x300 fs/dcache.c:1002
dput+0x1a/0x50 fs/dcache.c:1071
end_dirop fs/namei.c:2962 [inline]
filename_unlinkat+0x212/0x400 fs/namei.c:5740
__do_sys_unlink fs/namei.c:5772 [inline]
__se_sys_unlink+0x2b/0xe0 fs/namei.c:5769
__x64_sys_unlink+0x1f/0x30 fs/namei.c:5769
x64_sys_call+0x18ee/0x2550 arch/x86/include/generated/asm/syscalls_64.h:88
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x11e/0x3a0 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f

value changed: 0xffff8882376fd7f8 -> 0x0000000000000000

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 UID: 0 PID: 5148 Comm: udevd 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