FAILED: patch "[PATCH] 9p/xen: fix refcount leak in p9_xen_response() on wrong tag" failed to apply to 5.10-stable tree
Subsystems (2)
Sasha Levin
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 4d183e6f153245aca2534e372152583b868dd925
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From 4d183e6f153245aca2534e372152583b868dd925 Mon Sep 17 00:00:00 2001
From: Yifei Gao <[email protected]>
Date: Thu, 6 Aug 2026 14:42:54 +0000
Subject: [PATCH] 9p/xen: fix refcount leak in p9_xen_response() on wrong tag
p9_xen_response() looks up the request for an incoming reply with p9_tag_lookup(), which takes a reference on the returned p9_req_t. When the tag does not resolve to a request in REQ_STATUS_SENT, the function warns and continues the loop without dropping that reference, permanently leaking the p9_req_t and its msize buffers. The reply header, including the tag, is supplied by the backend, so a malicious or buggy 9P backend can leak kernel memory on every crafted response.
Drop the reference before continuing.
Message-ID: <[email protected]>
--- net/9p/trans_xen.c | 2 ++ 1 file changed, 2 insertions(+)
net/9p/trans_xen.c +2 -0
@@ -203,6 +203,8 @@ static void p9_xen_response(struct work_struct *work) req =p9_tag_lookup (priv->client, h.tag);if (!req || req->status !=REQ_STATUS_SENT ) {dev_warn (&priv->dev->dev,"Wrong req tag=%x\n" , h.tag); +if (req) +p9_req_put (priv->client, req); cons += h.size;virt_mb (); ring->intf->in_cons = cons;
Signature · 1 line
2.53.0
Sasha Levin
maintainerPATCH 1/1 9p/xen: fix refcount leak in p9_xen_response() on wrong tag
From: Yifei Gao <[email protected]>
[ Upstream commit 4d183e6f153245aca2534e372152583b868dd925 ]
p9_xen_response() looks up the request for an incoming reply with p9_tag_lookup(), which takes a reference on the returned p9_req_t. When the tag does not resolve to a request in REQ_STATUS_SENT, the function warns and continues the loop without dropping that reference, permanently leaking the p9_req_t and its msize buffers. The reply header, including the tag, is supplied by the backend, so a malicious or buggy 9P backend can leak kernel memory on every crafted response.
Drop the reference before continuing.
Message-ID: <[email protected]>
--- net/9p/trans_xen.c | 2 ++ 1 file changed, 2 insertions(+)
net/9p/trans_xen.c +2 -0
@@ -233,6 +233,8 @@ static void p9_xen_response(struct work_struct *work) req =p9_tag_lookup (priv->client, h.tag);if (!req || req->status !=REQ_STATUS_SENT ) {dev_warn (&priv->dev->dev,"Wrong req tag=%x\n" , h.tag); +if (req) +p9_req_put (req); cons += h.size;virt_mb (); ring->intf->in_cons = cons;
Signature · 1 line
2.53.0