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 C7083C4332F for ; Wed, 23 Nov 2022 09:41:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237999AbiKWJlS (ORCPT ); Wed, 23 Nov 2022 04:41:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238069AbiKWJkx (ORCPT ); Wed, 23 Nov 2022 04:40:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D69112D0B for ; Wed, 23 Nov 2022 01:38:10 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3AA9A619F9 for ; Wed, 23 Nov 2022 09:38:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47476C433D6; Wed, 23 Nov 2022 09:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669196289; bh=KPJi7WOtPixJppR84Il3tfKGbWmfwkKvZGMDrxbWUM4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bGjH3HKseDtr+Zvd+oHtMn0cYtzso6ibeDtGOdDwubotf0GB4rOly9/PpA9IszyfH Cs0jXLfjiNgpUu3idfyPLk7yYHAiAfGh6Rhe9DF6e8Cle2PCsW4Kt/kSLg+OTQ6W4m 4RFpjCEtPAb5/WF8YcoIByy2kcXgHKTlOXGeWzjo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com, Dominique Martinet , Schspa Shi Subject: [PATCH 5.15 172/181] 9p: trans_fd/p9_conn_cancel: drop client lock earlier Date: Wed, 23 Nov 2022 09:52:15 +0100 Message-Id: <20221123084609.784270602@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221123084602.707860461@linuxfoundation.org> References: <20221123084602.707860461@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dominique Martinet commit 52f1c45dde9136f964d63a77d19826c8a74e2c7f upstream. syzbot reported a double-lock here and we no longer need this lock after requests have been moved off to local list: just drop the lock earlier. Link: https://lkml.kernel.org/r/20220904064028.1305220-1-asmadeus@codewreck.org Reported-by: syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com Signed-off-by: Dominique Martinet Tested-by: Schspa Shi Signed-off-by: Greg Kroah-Hartman --- net/9p/trans_fd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -207,6 +207,8 @@ static void p9_conn_cancel(struct p9_con list_move(&req->req_list, &cancel_list); } + spin_unlock(&m->client->lock); + list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) { p9_debug(P9_DEBUG_ERROR, "call back req %p\n", req); list_del(&req->req_list); @@ -214,7 +216,6 @@ static void p9_conn_cancel(struct p9_con req->t_err = err; p9_client_cb(m->client, req, REQ_STATUS_ERROR); } - spin_unlock(&m->client->lock); } static __poll_t