[v6.1] possible deadlock in __wake_up

0 views
Skip to first unread message

syzbot

unread,
Apr 1, 2024, 1:05:28 PMApr 1
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: e5cd595e23c1 Linux 6.1.83
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12db0ac5180000
kernel config: https://syzkaller.appspot.com/x/.config?x=99d0cbbc2b2c7cfd
dashboard link: https://syzkaller.appspot.com/bug?extid=307a1c20dacb44bdcf84
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/cd28292a2eef/disk-e5cd595e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e8297fd856b2/vmlinux-e5cd595e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ea8c74634429/bzImage-e5cd595e.xz

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

============================================
WARNING: possible recursive locking detected
6.1.83-syzkaller #0 Not tainted
--------------------------------------------
syz-executor.3/6543 is trying to acquire lock:
ffff888076927378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline]
ffff888076927378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up+0xfd/0x1c0 kernel/sched/wait.c:160

but task is already holding lock:
ffff888076927378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline]
ffff888076927378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up+0xfd/0x1c0 kernel/sched/wait.c:160

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

CPU0
----
lock(&ctx->cq_wait);
lock(&ctx->cq_wait);

*** DEADLOCK ***

May be due to missing lock nesting notation

2 locks held by syz-executor.3/6543:
#0: ffff8880769270a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_enter io_uring/io_uring.c:3280 [inline]
#0: ffff8880769270a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __se_sys_io_uring_enter+0x336/0x2750 io_uring/io_uring.c:3213
#1: ffff888076927378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline]
#1: ffff888076927378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up+0xfd/0x1c0 kernel/sched/wait.c:160

stack backtrace:
CPU: 0 PID: 6543 Comm: syz-executor.3 Not tainted 6.1.83-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
__wake_up_common_lock kernel/sched/wait.c:137 [inline]
__wake_up+0xfd/0x1c0 kernel/sched/wait.c:160
__io_cqring_wake io_uring/io_uring.h:224 [inline]
io_req_local_work_add io_uring/io_uring.c:1117 [inline]
__io_req_task_work_add+0x3c7/0x5c0 io_uring/io_uring.c:1128
io_poll_wake+0x351/0x430 io_uring/poll.c:465
__wake_up_common+0x2a0/0x4e0 kernel/sched/wait.c:107
__wake_up_common_lock kernel/sched/wait.c:138 [inline]
__wake_up+0x11a/0x1c0 kernel/sched/wait.c:160
io_queue_sqe io_uring/io_uring.c:1910 [inline]
io_submit_sqe io_uring/io_uring.c:2162 [inline]
io_submit_sqes+0xf29/0x1e70 io_uring/io_uring.c:2275
__do_sys_io_uring_enter io_uring/io_uring.c:3281 [inline]
__se_sys_io_uring_enter+0x341/0x2750 io_uring/io_uring.c:3213
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f24c247dda9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f24c31ef0c8 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 00007f24c25abf80 RCX: 00007f24c247dda9
RDX: 0000000000000000 RSI: 00000000000053f8 RDI: 0000000000000003
RBP: 00007f24c24ca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f24c25abf80 R15: 00007ffe149cd698
</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 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

syzbot

unread,
Apr 1, 2024, 1:40:34 PMApr 1
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: e5cd595e23c1 Linux 6.1.83
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1350abfd180000
kernel config: https://syzkaller.appspot.com/x/.config?x=99d0cbbc2b2c7cfd
dashboard link: https://syzkaller.appspot.com/bug?extid=307a1c20dacb44bdcf84
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=1181512d180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1487e321180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/cd28292a2eef/disk-e5cd595e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e8297fd856b2/vmlinux-e5cd595e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ea8c74634429/bzImage-e5cd595e.xz

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

============================================
WARNING: possible recursive locking detected
6.1.83-syzkaller #0 Not tainted
--------------------------------------------
syz-executor285/3540 is trying to acquire lock:
ffff888029235378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline]
ffff888029235378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up+0xfd/0x1c0 kernel/sched/wait.c:160

but task is already holding lock:
ffff888029235378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline]
ffff888029235378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up+0xfd/0x1c0 kernel/sched/wait.c:160

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

CPU0
----
lock(&ctx->cq_wait);
lock(&ctx->cq_wait);

*** DEADLOCK ***

May be due to missing lock nesting notation

2 locks held by syz-executor285/3540:
#0: ffff8880292350a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __do_sys_io_uring_enter io_uring/io_uring.c:3280 [inline]
#0: ffff8880292350a8 (&ctx->uring_lock){+.+.}-{3:3}, at: __se_sys_io_uring_enter+0x336/0x2750 io_uring/io_uring.c:3213
#1: ffff888029235378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up_common_lock kernel/sched/wait.c:137 [inline]
#1: ffff888029235378 (&ctx->cq_wait){....}-{2:2}, at: __wake_up+0xfd/0x1c0 kernel/sched/wait.c:160

stack backtrace:
CPU: 1 PID: 3540 Comm: syz-executor285 Not tainted 6.1.83-syzkaller #0
RIP: 0033:0x7f7acc82a529
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc546b11c8 EFLAGS: 00000216 ORIG_RAX: 00000000000001aa
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7acc82a529
RDX: 0000000000000000 RSI: 00000000000053f8 RDI: 0000000000000003
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000216 R12: 0000000000000000
R13: 00007ffc546b1448 R14: 0000000000000001 R15: 0000000000000001
</TASK>


---
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.
Reply all
Reply to author
Forward
0 new messages