syzbot


possible deadlock in io_queue_linked_timeout

Status: closed as dup on 2020/08/10 16:02
Subsystems: io-uring fs
[Documentation on labels]
Reported-by: syzbot+d4586d3028284ff8a0be@syzkaller.appspotmail.com
First crash: 1348d, last: 1345d
Cause bisection: failed (error log, bisect log)
  
Duplicate of
Title Repro Cause bisect Fix bisect Count Last Reported
possible deadlock in __io_queue_deferred fs io-uring C error 1 1349d 1348d
Discussions (1)
Title Replies (including bot) Last reply
possible deadlock in io_queue_linked_timeout 1 (2) 2020/08/10 15:59

Sample crash report:
============================================
WARNING: possible recursive locking detected
5.8.0-syzkaller #0 Not tainted
--------------------------------------------
syz-executor960/6831 is trying to acquire lock:
ffff8880a66b54d8 (&ctx->completion_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline]
ffff8880a66b54d8 (&ctx->completion_lock){....}-{2:2}, at: io_queue_linked_timeout+0x4c/0x200 fs/io_uring.c:5928

but task is already holding lock:
ffff8880a66b54d8 (&ctx->completion_lock){....}-{2:2}, at: io_cqring_overflow_flush+0x814/0xaa0 fs/io_uring.c:1333

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

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

 *** DEADLOCK ***

 May be due to missing lock nesting notation

1 lock held by syz-executor960/6831:
 #0: ffff8880a66b54d8 (&ctx->completion_lock){....}-{2:2}, at: io_cqring_overflow_flush+0x814/0xaa0 fs/io_uring.c:1333

stack backtrace:
CPU: 0 PID: 6831 Comm: syz-executor960 Not tainted 5.8.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x18f/0x20d lib/dump_stack.c:118
 print_deadlock_bug kernel/locking/lockdep.c:2391 [inline]
 check_deadlock kernel/locking/lockdep.c:2432 [inline]
 validate_chain kernel/locking/lockdep.c:3202 [inline]
 __lock_acquire.cold+0x115/0x396 kernel/locking/lockdep.c:4426
 lock_acquire+0x1f1/0xad0 kernel/locking/lockdep.c:5005
 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline]
 _raw_spin_lock_irq+0x5b/0x80 kernel/locking/spinlock.c:167
 spin_lock_irq include/linux/spinlock.h:379 [inline]
 io_queue_linked_timeout+0x4c/0x200 fs/io_uring.c:5928
 __io_queue_async_work+0x1f8/0x4c0 fs/io_uring.c:1192
 __io_queue_deferred fs/io_uring.c:1237 [inline]
 io_commit_cqring+0x456/0x7a0 fs/io_uring.c:1265
 io_cqring_overflow_flush+0x5b8/0xaa0 fs/io_uring.c:1359
 io_ring_ctx_wait_and_kill+0x30e/0x600 fs/io_uring.c:7808
 io_uring_release+0x3e/0x50 fs/io_uring.c:7829
 __fput+0x285/0x920 fs/file_table.c:281
 task_work_run+0xdd/0x190 kernel/task_work.c:135
 exit_task_work include/linux/task_work.h:25 [inline]
 do_exit+0xb7d/0x29f0 kernel/exit.c:806
 do_group_exit+0x125/0x310 kernel/exit.c:903
 __do_sys_exit_group kernel/exit.c:914 [inline]
 __se_sys_exit_group kernel/exit.c:912 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:912
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x43f598
Code: Bad RIP value.
RSP: 002b:00007ffd0cbd6088 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000043f598
RDX: 0000000000000000 RSI: 000000000000003c RDI: 0000000000000000
RBP: 00000000004beda8 R08: 00000000000000e7 R09: ffffffffffffffd0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006d11a0 R14: 0000000000000000 R15: 0000000000000000

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/08/11 06:59 upstream fc80c51fd4b2 7adc7b65 .config console log report syz C ci-upstream-kasan-gce-root
2020/08/09 21:19 upstream 06a81c1c7db9 70301872 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2020/08/13 05:14 linux-next bc09acc9f224 bc15f7db .config console log report syz C ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.