[v6.1] possible deadlock in queue_stack_map_push_elem

0 views
Skip to first unread message

syzbot

unread,
Apr 11, 2024, 2:39:26 PMApr 11
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: bf1e3b1cb1e0 Linux 6.1.85
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1611255d180000
kernel config: https://syzkaller.appspot.com/x/.config?x=d3e21b90946dbbab
dashboard link: https://syzkaller.appspot.com/bug?extid=11cdb632b3437d02da7d
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=136cb105180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=166d9843180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/686a8153616f/disk-bf1e3b1c.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/1e494c0feb8c/vmlinux-bf1e3b1c.xz
kernel image: https://storage.googleapis.com/syzbot-assets/fa38d0bc0763/bzImage-bf1e3b1c.xz

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

============================================
WARNING: possible recursive locking detected
6.1.85-syzkaller #0 Not tainted
--------------------------------------------
syz-executor314/3560 is trying to acquire lock:
ffff88807b646218 (&qs->lock){..-.}-{2:2}, at: queue_stack_map_push_elem+0x1ac/0x650 kernel/bpf/queue_stack_maps.c:214

but task is already holding lock:
ffff8880778de218 (&qs->lock){..-.}-{2:2}, at: queue_stack_map_push_elem+0x1ac/0x650 kernel/bpf/queue_stack_maps.c:214

other info that might help us debug this:
Possible unsafe locking scenario:

CPU0
----
lock(&qs->lock);
lock(&qs->lock);

*** DEADLOCK ***

May be due to missing lock nesting notation

4 locks held by syz-executor314/3560:
#0: ffff8880201f6d38 (&tsk->futex_exit_mutex){+.+.}-{3:3}, at: futex_cleanup_begin kernel/futex/core.c:1076 [inline]
#0: ffff8880201f6d38 (&tsk->futex_exit_mutex){+.+.}-{3:3}, at: futex_exit_release+0x30/0x1e0 kernel/futex/core.c:1128
#1: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#1: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
#1: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
#1: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312
#2: ffff8880778de218 (&qs->lock){..-.}-{2:2}, at: queue_stack_map_push_elem+0x1ac/0x650 kernel/bpf/queue_stack_maps.c:214
#3: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire include/linux/rcupdate.h:350 [inline]
#3: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: rcu_read_lock include/linux/rcupdate.h:791 [inline]
#3: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: __bpf_trace_run kernel/trace/bpf_trace.c:2272 [inline]
#3: ffffffff8d12ac40 (rcu_read_lock){....}-{1:2}, at: bpf_trace_run2+0x110/0x410 kernel/trace/bpf_trace.c:2312

stack backtrace:
CPU: 1 PID: 3560 Comm: syz-executor314 Not tainted 6.1.85-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_deadlock_bug kernel/locking/lockdep.c:2983 [inline]
check_deadlock kernel/locking/lockdep.c:3026 [inline]
validate_chain+0x4711/0x5950 kernel/locking/lockdep.c:3812
__lock_acquire+0x125b/0x1f80 kernel/locking/lockdep.c:5049
lock_acquire+0x1f8/0x5a0 kernel/locking/lockdep.c:5662
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0xd1/0x120 kernel/locking/spinlock.c:162
queue_stack_map_push_elem+0x1ac/0x650 kernel/bpf/queue_stack_maps.c:214
</TASK>


---
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 syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

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