public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Dominique Martinet <asmadeus@codewreck.org>,
	syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com,
	Schspa Shi <schspa@gmail.com>, Sasha Levin <sashal@kernel.org>,
	ericvh@gmail.com, lucho@ionkov.net, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	v9fs-developer@lists.sourceforge.net, netdev@vger.kernel.org
Subject: [PATCH AUTOSEL 4.9 6/8] 9p: trans_fd/p9_conn_cancel: drop client lock earlier
Date: Mon, 17 Oct 2022 20:12:00 -0400	[thread overview]
Message-ID: <20221018001202.2732458-6-sashal@kernel.org> (raw)
In-Reply-To: <20221018001202.2732458-1-sashal@kernel.org>

From: Dominique Martinet <asmadeus@codewreck.org>

[ Upstream commit 52f1c45dde9136f964d63a77d19826c8a74e2c7f ]

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 <asmadeus@codewreck.org>
Tested-by: Schspa Shi <schspa@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 net/9p/trans_fd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 33b317a25a2d..83cdb13c6322 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -215,6 +215,8 @@ static void p9_conn_cancel(struct p9_conn *m, int err)
 		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);
@@ -222,7 +224,6 @@ static void p9_conn_cancel(struct p9_conn *m, int err)
 			req->t_err = err;
 		p9_client_cb(m->client, req, REQ_STATUS_ERROR);
 	}
-	spin_unlock(&m->client->lock);
 }
 
 static int
-- 
2.35.1


  parent reply	other threads:[~2022-10-18  0:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  0:11 [PATCH AUTOSEL 4.9 1/8] of/fdt: Don't calculate initrd size from DT if start > end Sasha Levin
2022-10-18  0:11 ` [PATCH AUTOSEL 4.9 2/8] objtool,x86: Teach decode about LOOP* instructions Sasha Levin
2022-10-18  0:11 ` [PATCH AUTOSEL 4.9 3/8] gfs2: Check sb_bsize_shift after reading superblock Sasha Levin
2022-10-18  0:11 ` [PATCH AUTOSEL 4.9 4/8] m68knommu: fix non-specific 68328 choice interrupt build failure Sasha Levin
2022-10-18  0:11 ` [PATCH AUTOSEL 4.9 5/8] m68knommu: fix non-mmu classic 68000 legacy timer tick selection Sasha Levin
2022-10-18  0:12 ` Sasha Levin [this message]
2022-10-18  0:12 ` [PATCH AUTOSEL 4.9 7/8] 9p/trans_fd: always use O_NONBLOCK read/write Sasha Levin
2022-10-18  0:12 ` [PATCH AUTOSEL 4.9 8/8] virtio_pci: don't try to use intxif pin is zero Sasha Levin
2022-10-19  0:27   ` Angus Chen
2022-10-19  5:58     ` Michael S. Tsirkin
2022-10-18  9:37 ` [PATCH AUTOSEL 4.9 1/8] of/fdt: Don't calculate initrd size from DT if start > end Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221018001202.2732458-6-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=asmadeus@codewreck.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ericvh@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=schspa@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+50f7e8d06c3768dd97f3@syzkaller.appspotmail.com \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox