From: Simon Horman <horms@kernel.org>
To: Yuqi Xu <xuyuqiabc@gmail.com>
Cc: netdev@vger.kernel.org, oe-linux-nfc@lists.linux.dev,
David Heidelberg <david@ixit.cz>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
stable@vger.kernel.org, Vega <vega@nebusec.ai>,
Ren Wei <weir@nebusec.ai>,
xuyq21@lenovo.com
Subject: Re: [PATCH net 1/1] nfc: llcp: fix use-after-free when purging local
Date: Thu, 29 Oct 2026 10:09:47 +0000 [thread overview]
Message-ID: <20261029100947.GE257209@horms.kernel.org> (raw)
In-Reply-To: <1792999447.107874-1-xuyuqiabc@gmail.com>
On Mon, Oct 26, 2026 at 03:24:07PM +0800, Yuqi Xu wrote:
> nfc_llcp_socket_purge() walks local->tx_queue with
> skb_queue_walk_safe() and unlinks matching skbs. The walk does not
> hold local->tx_queue.lock. tx_work, the LLCP send path, and other
> purge or dequeue sites mutate that queue under the lock, so the
> walker can follow an skb that another CPU has already freed. That
> is a use-after-free and can corrupt the list.
>
> Hold the queue lock across the walk, unlink with __skb_unlink(), and
> free the detached skbs only after the lock is dropped.
>
> Fixes: f31652a58bee ("NFC: Purge LLCP socket Tx queues when being disconnected")
> Cc: stable@vger.kernel.org
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: LLM
> Signed-off-by: Yuqi Xu <xuyuqiabc@gmail.com>
> Reviewed-by: Ren Wei <weir@nebusec.ai>
Reviewed-by: Simon Horman <horms@kernel.org>
prev parent reply other threads:[~2026-10-29 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 7:24 [PATCH net 0/1] nfc: llcp: fix use-after-free when purging local Yuqi Xu
2026-10-26 7:24 ` [PATCH net 1/1] " Yuqi Xu
2026-10-29 10:09 ` Simon Horman [this message]
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=20261029100947.GE257209@horms.kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=david@ixit.cz \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oe-linux-nfc@lists.linux.dev \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=vega@nebusec.ai \
--cc=weir@nebusec.ai \
--cc=xuyq21@lenovo.com \
--cc=xuyuqiabc@gmail.com \
/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