From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A78F2C00140 for ; Mon, 8 Aug 2022 14:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236032AbiHHOO1 (ORCPT ); Mon, 8 Aug 2022 10:14:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233836AbiHHOOZ (ORCPT ); Mon, 8 Aug 2022 10:14:25 -0400 Received: from mail-io1-f69.google.com (mail-io1-f69.google.com [209.85.166.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 634AAEE1B for ; Mon, 8 Aug 2022 07:14:24 -0700 (PDT) Received: by mail-io1-f69.google.com with SMTP id x2-20020a6bfe02000000b00682bffede8fso4541505ioh.2 for ; Mon, 08 Aug 2022 07:14:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc; bh=JbxttqbDHdfUzYooNKEfPwjaG5YKBPoGxF8SI8GnlAo=; b=1dDiurla0IaH24lEc5KBOJN3PKqFzY/9qP3IqxW9CwnVkqTvG6LWOee00xOPapEYUd 3Bo4D7/N1GB9O3cCcjYWGgd8im0JXn8Uh1JQovwQgc1hL3Uq0U5HQwiZPETd29KNEmJO YFZEjxawkqBCe8xjN7IRBbf31KU1Mi+TQZhv/odChaj8qENuD1Q5kVWZZDqQiNBYIq5G XN+qUjBueDvBwzE8VeAp1fTsudoBxilNUApMmevurWl61xId+t3VLEtEeugnmyk+eXvC JL3tjHH8+bkSms3bceLOFeruKk597HIEfpwh3gXmCQRL8SVG/kQWd7k52CWb9nwjRNRY DPzQ== X-Gm-Message-State: ACgBeo0PdXuly0odYJZFaTdQRhyIetU2CSlIbSsHexvq/BwNRS1Lnxho dbxSg6+08foGHQg5gpVfo5+7TGzBKIGc9ACdAW1yMvk86J/u X-Google-Smtp-Source: AA6agR5g0KpuQOyObZUkfCjHm/y5cz64ijRFmojwXbbmyIAIPgevNyi2viWTAmjmlWlOpT1XbciZ1k0dMqDKrjw6SkJscr0hfjhn MIME-Version: 1.0 X-Received: by 2002:a5e:a70f:0:b0:684:d596:b7e7 with SMTP id b15-20020a5ea70f000000b00684d596b7e7mr1192526iod.84.1659968063797; Mon, 08 Aug 2022 07:14:23 -0700 (PDT) Date: Mon, 08 Aug 2022 07:14:23 -0700 In-Reply-To: <000000000000cad57405e5b5dbb7@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <000000000000c7ff6a05e5bb6ec8@google.com> Subject: Re: [syzbot] possible deadlock in p9_req_put From: syzbot To: asmadeus@codewreck.org, davem@davemloft.net, edumazet@google.com, ericvh@gmail.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux_oss@crudebyte.com, lucho@ionkov.net, netdev@vger.kernel.org, pabeni@redhat.com, syzkaller-bugs@googlegroups.com, v9fs-developer@lists.sourceforge.net Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org syzbot has found a reproducer for the following issue on: HEAD commit: ca688bff68bc Add linux-next specific files for 20220808 git tree: linux-next console+strace: https://syzkaller.appspot.com/x/log.txt?x=1408148e080000 kernel config: https://syzkaller.appspot.com/x/.config?x=4c20e006003cdecb dashboard link: https://syzkaller.appspot.com/bug?extid=50f7e8d06c3768dd97f3 compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11f6ea66080000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1640de8e080000 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com ============================================ WARNING: possible recursive locking detected 5.19.0-next-20220808-syzkaller #0 Not tainted -------------------------------------------- kworker/1:2/1590 is trying to acquire lock: ffff888079686c18 (&clnt->lock){+.+.}-{2:2}, at: p9_tag_remove net/9p/client.c:367 [inline] ffff888079686c18 (&clnt->lock){+.+.}-{2:2}, at: p9_req_put net/9p/client.c:375 [inline] ffff888079686c18 (&clnt->lock){+.+.}-{2:2}, at: p9_req_put+0xc6/0x250 net/9p/client.c:372 but task is already holding lock: ffff888079686c18 (&clnt->lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] ffff888079686c18 (&clnt->lock){+.+.}-{2:2}, at: p9_conn_cancel+0xaa/0x970 net/9p/trans_fd.c:192 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&clnt->lock); lock(&clnt->lock); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by kworker/1:2/1590: #0: ffff888011864d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic64_set arch/x86/include/asm/atomic64_64.h:34 [inline] #0: ffff888011864d38 ((wq_completion)events){+.+.}-{0:0}, at: arch_atomic_long_set include/linux/atomic/atomic-long.h:41 [inline] #0: ffff888011864d38 ((wq_completion)events){+.+.}-{0:0}, at: atomic_long_set include/linux/atomic/atomic-instrumented.h:1280 [inline] #0: ffff888011864d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_data kernel/workqueue.c:636 [inline] #0: ffff888011864d38 ((wq_completion)events){+.+.}-{0:0}, at: set_work_pool_and_clear_pending kernel/workqueue.c:663 [inline] #0: ffff888011864d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x87a/0x1610 kernel/workqueue.c:2260 #1: ffffc90006357da8 (p9_poll_work){+.+.}-{0:0}, at: process_one_work+0x8ae/0x1610 kernel/workqueue.c:2264 #2: ffff888079686c18 (&clnt->lock){+.+.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] #2: ffff888079686c18 (&clnt->lock){+.+.}-{2:2}, at: p9_conn_cancel+0xaa/0x970 net/9p/trans_fd.c:192 stack backtrace: CPU: 1 PID: 1590 Comm: kworker/1:2 Not tainted 5.19.0-next-20220808-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Workqueue: events p9_poll_workfn Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_deadlock_bug kernel/locking/lockdep.c:2988 [inline] check_deadlock kernel/locking/lockdep.c:3031 [inline] validate_chain kernel/locking/lockdep.c:3816 [inline] __lock_acquire.cold+0x116/0x3a7 kernel/locking/lockdep.c:5053 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 p9_tag_remove net/9p/client.c:367 [inline] p9_req_put net/9p/client.c:375 [inline] p9_req_put+0xc6/0x250 net/9p/client.c:372 p9_conn_cancel+0x640/0x970 net/9p/trans_fd.c:213 p9_poll_mux net/9p/trans_fd.c:627 [inline] p9_poll_workfn+0x25d/0x4e0 net/9p/trans_fd.c:1147 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306