Article View: linux.kernel.netdev
Article #8510Re: [PATCH net 1/1] nfc: llcp: fix use-after-free when purging local
From: Simon Horman
Date: Thu, 29 Oct 2026 10:09
Date: Thu, 29 Oct 2026 10:09
20 lines
8651 bytes
8651 bytes
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>
Technical Details
Message-ID:
<20261029100947.GE257209@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353229-linux-kernel-netdev=dewy.ruReferences:
<cover.1791171477.git.xuyuqiabc@gmail.com> <1792999447.107874-1-xuyuqiabc@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-353229-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/1] nfc: llcp: fix use-after-free when purging local Date: Thu, 29 Oct 2026 10:09:47 +0000 Organization: Usenet Network Message-ID: <20261029100947.GE257209@horms.kernel.org> References: <cover.1791171477.git.xuyuqiabc@gmail.com> <1792999447.107874-1-xuyuqiabc@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1981531"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:zezgyMcJNx55RS81DM89TKB5UWk= sha256:eSXA9CgdjAchMX2jTBVMByDNeydAR4sSj72VKb9ETSU= sha1:/jOsOiI2cGQgQkw1dwee7hhblVI= sha256:9G1O/AfrCotiKIDD/9A4ekMeiU/P/G4GjjLbywqBCvQ= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 6EA0A125C5F; Thu, 29 Oct 2026 13:14:20 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.401 X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 76kEzPVvDQC0; Thu, 29 Oct 2026 13:14:14 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-353229-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id CCB2412580F; Thu, 29 Oct 2026 13:14:03 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 929AD2A186; Thu, 29 Oct 2026 10:09:58 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793268598; b=JyX9S9cccA03an/Lu8BoeokQdDvz6hBrNzp8Z3T4cw9Yh+iJcksC3JyPtyp8YTv4vCYf lCJfReS8rfpT4itel+pZ9IP/8JMKE+3JYS2/laMKCKZOTdMuHKDJlu0DJbbjxoHsC8lKi jUSDSXHjepvrEUW7fcUZU+Da7O5CuSUphDAR3XWQncXpv4XZyGXWXP6gIvTYwRAp6Y13u eWW6/FCGsoNiz3KfK0nhVmgeWFcjU1tkWjeNdXfJwDjTp/YA4Z6b/JMxDMmP9lgUozJhq w5K3NKT1aUp3SvU46jFY4Yhr0Ddx60L1JrdOdb9avPjwsqCsCf9OxLrzthFAwZ6RZag== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793268598; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=nxNqgHP3UUpuLSiMHFFX/1xCgm70UtF7AKQcrmX1fpY=; b=4B38KCWDzUGw5MgdrdfThDXLIEbzNZA+pffYM2qqIWujnWQgSVlUmTgjcF0+1XYOfYKB BBtGcW+4XlQGkqc3Vl0kOwCZFsg6u0DX96GPxO33eMnDNKTDN4F7sM2QG/VGmhphjlHSH iEJXDpYVpq1DRYz5l2dQnSSw/GO6MPrPFZZ07wUQmNo/AoyoIxFOvOCU+M8OdwpMsk3IO Lp5A8gJkFOdR0jL6W+XdKHGWwogtOdcvOKU+uRxWtyED+ewv0c8A0CAIIF1CmdYezRakX 8eEDKiR22yH/n/JUmz/uhSGJzAvwjBnWUAZBUeWfgDNWCnhlE9PmSH+AFGrIkT2hpqQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iYL6nkR2; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 67F57606A323; Thu, 29 Oct 2026 10:09:58 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iYL6nkR2 X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793268592; b=qaKoxIle8jk3eez4qPqnMFGRy91cGPv8MnA/K1krwZZGikzEfb7FVbogOsD9/ZVDBPip mRBZMNCgsyBmiBKmHUTacbCu+Cp3uk+hX9PRS3hVe1JrDz1ypFjduukVSb+kAJanyVUgf lRSgODI2nJcRkxaMrl7lScM7T0nwvyctz4CdTrRqf3nxq7v6zLaDAcPnWgaEm4Fl9Rf/b KpGof147ct1hYBKmGdMR1Z6PHYqdmMD3tnuHYpisxThnftY2bvOsClOKjxwIjbSc04L8X ZC0YBc/nGQrhyB/wE49gNMhPzukueBQsjrfSXgx8E6xXS267SnIKMWF1s+1VTQKrgBw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793268592; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=nxNqgHP3UUpuLSiMHFFX/1xCgm70UtF7AKQcrmX1fpY=; b=fYQJOV33VX3ex4gWJVhyzr3p+DWOAPou8KatYCIMZvTm8nlTUnPMvfBFKPb7htcVal+I /w+kuQiVgEb2jnC9TrWAXX8a7PuqGOz+RTye9CC21WNrk5KBW8DbfDUMxml0CPje1Y8+p jaP35RPnab5FJGMunaLkbXs73K1N3dno/Bmsl8T/uvj32CIflKYx5p0954eyPsYlVx3Bk yxQzdcWOfHts3HNDLmttQknAl2Ehs0SirORozNb1EILR0NB+K1Mm8yHo+rBTGOump9kch etJ6llEu3hk/onsP0su9rrlyRdrV51995Qvb9h3KnvESEg0Up7VoprfObtgeMDQ8KCg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=iYL6nkR2; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4145B606A31D; Thu, 29 Oct 2026 10:09:52 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC9FE1F01825; Thu, 29 Oct 2026 10:09:49 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793268591; bh=nxNqgHP3UUpuLSiMHFFX/1xCgm70UtF7AKQcrmX1fpY=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=iYL6nkR2kGVEIZgKxnVxk5ATyNVQ/EsyrGT/YLsuiPCj7ieJ1g6uwzlIw9w6h0MtQ AA9uYCTe55u5TNH0BxeybB+g65eDECrfucb0yJPxrCk47aBvU8lg/J7ZVtmVonG5MT U8nQrXMxKhHKkYOYc30igEtNrBd/A2jeaDt4BWMPs7jkeFVSw1RHESPzlPpZZQYzJa h9bl49LXKAmWEPMp54/0qG93a8AYxSXvG3Al7oRW85NUwqo2SBsvhfL1OWdheHt95Q L5GQWys/h1iSPHd9BxZXkHgc4S7KvXUkaBzC05lcpI27nk7/zJ6Ty4OxTlAUnJESav ia2qGR0SZ3GLA== X-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 X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <1792999447.107874-1-xuyuqiabc@gmail.com>