[moderation] [keyrings?] [lsm?] KCSAN: data-race in key_garbage_collector / key_gc_timer_func

0 views
Skip to first unread message

syzbot

unread,
May 19, 2024, 2:19:21 AMMay 19
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 0450d2083be6 Merge tag '6.10-rc-smb-fix' of git://git.samb..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11867b84980000
kernel config: https://syzkaller.appspot.com/x/.config?x=9cea9d6e22e152b5
dashboard link: https://syzkaller.appspot.com/bug?extid=50734439fade48eabef6
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
CC: [dhow...@redhat.com jar...@kernel.org jmo...@namei.org keyr...@vger.kernel.org linux-...@vger.kernel.org linux-secu...@vger.kernel.org pa...@paul-moore.com se...@hallyn.com]

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/04c015715988/disk-0450d208.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/93f908c0c5bd/vmlinux-0450d208.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ead896346b5c/bzImage-0450d208.xz

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

==================================================================
BUG: KCSAN: data-race in key_garbage_collector / key_gc_timer_func

write to 0xffffffff861dddd0 of 8 bytes by interrupt on cpu 0:
key_gc_timer_func+0x15/0x60 security/keys/gc.c:98
call_timer_fn+0x3a/0x300 kernel/time/timer.c:1792
expire_timers kernel/time/timer.c:1843 [inline]
__run_timers kernel/time/timer.c:2417 [inline]
__run_timer_base+0x417/0x640 kernel/time/timer.c:2428
run_timer_base kernel/time/timer.c:2437 [inline]
run_timer_softirq+0x31/0x70 kernel/time/timer.c:2447
handle_softirqs+0xc8/0x290 kernel/softirq.c:554
__do_softirq kernel/softirq.c:588 [inline]
invoke_softirq kernel/softirq.c:428 [inline]
__irq_exit_rcu kernel/softirq.c:637 [inline]
irq_exit_rcu+0x3e/0x90 kernel/softirq.c:649
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
sysvec_apic_timer_interrupt+0x73/0x80 arch/x86/kernel/apic/apic.c:1043
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
kcsan_setup_watchpoint+0x404/0x410 kernel/kcsan/core.c:705
native_save_fl arch/x86/include/asm/irqflags.h:32 [inline]
arch_local_save_flags arch/x86/include/asm/irqflags.h:67 [inline]
arch_local_irq_save arch/x86/include/asm/irqflags.h:103 [inline]
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline]
_raw_spin_lock_irqsave+0x3c/0xb0 kernel/locking/spinlock.c:162
prepare_to_wait_exclusive+0x23/0xb0 kernel/sched/wait.c:250
io_cqring_wait io_uring/io_uring.c:2491 [inline]
__do_sys_io_uring_enter io_uring/io_uring.c:3291 [inline]
__se_sys_io_uring_enter+0xe25/0x15a0 io_uring/io_uring.c:3183
__x64_sys_io_uring_enter+0x78/0x90 io_uring/io_uring.c:3183
x64_sys_call+0x263/0x2d30 arch/x86/include/generated/asm/syscalls_64.h:427
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x1d0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f

read to 0xffffffff861dddd0 of 8 bytes by task 13015 on cpu 1:
key_schedule_gc security/keys/gc.c:61 [inline]
key_garbage_collector+0x6ab/0x900 security/keys/gc.c:284
process_one_work kernel/workqueue.c:3231 [inline]
process_scheduled_works+0x483/0x9a0 kernel/workqueue.c:3312
worker_thread+0x526/0x730 kernel/workqueue.c:3393
kthread+0x1d1/0x210 kernel/kthread.c:389
ret_from_fork+0x4b/0x60 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

value changed: 0x000000006649999f -> 0x7fffffffffffffff

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 13015 Comm: kworker/1:7 Not tainted 6.9.0-syzkaller-08995-g0450d2083be6 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Workqueue: events key_garbage_collector
==================================================================


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