Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4419420pxa; Mon, 10 Aug 2020 08:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxOhSvas/jDVWpjO+RN3JC4lGBKDmO8IldEbs2c/AZiJTG/E3dDtp3LmiWEHKLtcZ9V6Z0 X-Received: by 2002:aa7:cd6c:: with SMTP id ca12mr20849927edb.365.1597073954306; Mon, 10 Aug 2020 08:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597073954; cv=none; d=google.com; s=arc-20160816; b=pzL/HvM24V3yRdNoWFXcwWn0fSPruAZuYg4RihsI7YNtnnVJGZIQC96xG1AYG0qCii dKw3kDDs+jCzTT0cc3NOIaFvH22Gj3z4h9Yw4SU4xWYlECBxHlAPVe/j1Yvk1Jv8xhsD WCcqT4LM/Set48dNYZUCLrVkTPUZY7eF5+QlKw6evmBvqteXprvHfcYkxNS/7VB9dO99 jdk2nJ595fOgsv7Q9SiAaAIgrJ1UIgGKIhA7nIFbixDpQxnEtxAJTt4ElYWCeCtPlfpm LT+iYA1DEaDBfR5C3dMmIPqFCmFdaOYa79hZzOl9hPjjwv5Yklx0gE+4DLQUajdUtv+r H6dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:from:subject:message-id:date :mime-version; bh=+fLG61A9eCuOJ+VN2LjNHXpvQaE3FxmNy9hu4vih70E=; b=OY9xLFB8txxzxp2l3z7nSswTRFqeQOEo7EP/Xf1ZyivLgj/aBGMNW22WqxbQ1cHnHL jmc+/4K1nIkz0KTwudRaaGx8m26Po+8dkegECvlWIDHGW0pjxKeBw8XOqJg0rt98w24C UvFu6WAsdLef9F7lHoNe9PmWMtSbWoA6RtxIvBLawdQyEQxcdK4SSrNybvF8BMCSdbVh m+OpMAdECsLocEsDJvRvCMsNPe10XjqIUhkjw7uP57R2IiSQRf0yOditV9xqLJME1F6I PLkW+PGcdltFtaXTGBzpB17I/XGwp422Zras5xfQunx0Ayv6fK+dbjXsI1Ny5+DkJM1L N4Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si12013642ejp.201.2020.08.10.08.38.51; Mon, 10 Aug 2020 08:39:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=appspotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729288AbgHJPgZ (ORCPT + 99 others); Mon, 10 Aug 2020 11:36:25 -0400 Received: from mail-il1-f199.google.com ([209.85.166.199]:40821 "EHLO mail-il1-f199.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728265AbgHJPgS (ORCPT ); Mon, 10 Aug 2020 11:36:18 -0400 Received: by mail-il1-f199.google.com with SMTP id z16so8126750ill.7 for ; Mon, 10 Aug 2020 08:36:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=+fLG61A9eCuOJ+VN2LjNHXpvQaE3FxmNy9hu4vih70E=; b=L7TrJ7mfkTlqTWkPbfVJkpobwPEpGESLvwSX63PQGxkGWoJwBTNUxnGgLLYaI6gPJr t3Y1EL1uY84K08Iq0LYLGPbkg0WxSnTFpnXRRfjPT7KwBX13eIOd5dup1xZPtOvyww4a Rxaro2a8WuJXIERJjtHEjQlK9Xt2RwtebJ/DyfplVxjWOnmouCqmTOZ1/P8oflFACcPo /0USwz3yfK6zY/DSVEzIRphwD4kChaxdmy5gnjIMMqTmWAdv913bfocPgd6GISWbBYmT fgVFarodt8bk9slgTJlEG5WGgKOFs6X7nV2SPS0uM8SISOKS1wkAiobVdROwN1f9frLj pWFw== X-Gm-Message-State: AOAM533SeXHrhEMuSxkEwqn54SrvdyPs7jjV0x/I+9esJJGGM3ePXXZW AiiucNZ+gEf2RERFhxqpf3eN+XPETnXkoKWKa5Vf941Hz2tu MIME-Version: 1.0 X-Received: by 2002:a05:6638:1129:: with SMTP id f9mr20086051jar.35.1597073777883; Mon, 10 Aug 2020 08:36:17 -0700 (PDT) Date: Mon, 10 Aug 2020 08:36:17 -0700 X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <00000000000035fdf505ac87b7f9@google.com> Subject: possible deadlock in __io_queue_deferred From: syzbot To: axboe@kernel.dk, io-uring@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, viro@zeniv.linux.org.uk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, syzbot found the following issue on: HEAD commit: 449dc8c9 Merge tag 'for-v5.9' of git://git.kernel.org/pub/.. git tree: upstream console output: https://syzkaller.appspot.com/x/log.txt?x=14d41e02900000 kernel config: https://syzkaller.appspot.com/x/.config?x=9d25235bf0162fbc dashboard link: https://syzkaller.appspot.com/bug?extid=996f91b6ec3812c48042 compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81) syz repro: https://syzkaller.appspot.com/x/repro.syz?x=133c9006900000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1191cb1a900000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+996f91b6ec3812c48042@syzkaller.appspotmail.com ============================================ WARNING: possible recursive locking detected 5.8.0-syzkaller #0 Not tainted -------------------------------------------- syz-executor287/6816 is trying to acquire lock: ffff888093cdb4d8 (&ctx->completion_lock){....}-{2:2}, at: spin_lock_irq include/linux/spinlock.h:379 [inline] ffff888093cdb4d8 (&ctx->completion_lock){....}-{2:2}, at: io_queue_linked_timeout fs/io_uring.c:5928 [inline] ffff888093cdb4d8 (&ctx->completion_lock){....}-{2:2}, at: __io_queue_async_work fs/io_uring.c:1192 [inline] ffff888093cdb4d8 (&ctx->completion_lock){....}-{2:2}, at: __io_queue_deferred+0x36a/0x790 fs/io_uring.c:1237 but task is already holding lock: ffff888093cdb4d8 (&ctx->completion_lock){....}-{2:2}, at: io_cqring_overflow_flush+0xc6/0xab0 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-executor287/6816: #0: ffff888093cdb4d8 (&ctx->completion_lock){....}-{2:2}, at: io_cqring_overflow_flush+0xc6/0xab0 fs/io_uring.c:1333 stack backtrace: CPU: 1 PID: 6816 Comm: syz-executor287 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+0x1f0/0x31e lib/dump_stack.c:118 print_deadlock_bug kernel/locking/lockdep.c:2391 [inline] check_deadlock kernel/locking/lockdep.c:2432 [inline] validate_chain+0x69a4/0x88a0 kernel/locking/lockdep.c:3202 __lock_acquire+0x1161/0x2ab0 kernel/locking/lockdep.c:4426 lock_acquire+0x160/0x730 kernel/locking/lockdep.c:5005 __raw_spin_lock_irq include/linux/spinlock_api_smp.h:128 [inline] _raw_spin_lock_irq+0x67/0x80 kernel/locking/spinlock.c:167 spin_lock_irq include/linux/spinlock.h:379 [inline] io_queue_linked_timeout fs/io_uring.c:5928 [inline] __io_queue_async_work fs/io_uring.c:1192 [inline] __io_queue_deferred+0x36a/0x790 fs/io_uring.c:1237 io_cqring_overflow_flush+0x774/0xab0 fs/io_uring.c:1359 io_ring_ctx_wait_and_kill+0x2a1/0x570 fs/io_uring.c:7808 io_uring_release+0x59/0x70 fs/io_uring.c:7829 __fput+0x34f/0x7b0 fs/file_table.c:281 task_work_run+0x137/0x1c0 kernel/task_work.c:135 exit_task_work include/linux/task_work.h:25 [inline] do_exit+0x5f3/0x1f20 kernel/exit.c:806 do_group_exit+0x161/0x2d0 kernel/exit.c:903 __do_sys_exit_group+0x13/0x20 kernel/exit.c:914 __se_sys_exit_group+0x10/0x10 kernel/exit.c:912 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:912 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x43f598 Code: Bad RIP value. RSP: 002b:00007fffdac2bf58 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 --- 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 syzkaller@googlegroups.com. syzbot will keep track of this issue. See: https://goo.gl/tpsmEJ#status for how to communicate with syzbot. syzbot can test patches for this issue, for details see: https://goo.gl/tpsmEJ#testing-patches