Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 134D83B2FED; Mon, 23 Mar 2026 14:50:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277453; cv=none; b=gU8h9Y0EtqarAJ7uttdb6Qv1OAZz/uLf1XgMDkk/vtVECm4dUwFcXIFxeMSdy7LjyxkZa3mAjJ5s14WjT26YqN50ew7Cs43hH0tFwEE3kIp6puSIHd3zjynA1UxSw/e+m73tcMbDYOGUbqfVh3g/UjtBOROPnKKim44emgcZGFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774277453; c=relaxed/simple; bh=zrFlRdL1kPi1dZFh2wfA4GxGC6ccVm415SQpAT3T434=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i9a0DtQNblJx1zIma1Z9OP9E3CEbmDLGU1gzrtzSD6phMWChERLR95DGpU4i/tIb6TIDtw6huGFfMpEPBqtHxOHSKDYQzsEAakYhA9asbaTUdvf8Y2tyeGpK3vfzzKSbi6gR/NwC4KA481Mr2nheDvEWrOE4n0koOcNZzX7QbUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=J9OjGF8x; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="J9OjGF8x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CCFFC4CEF7; Mon, 23 Mar 2026 14:50:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774277453; bh=zrFlRdL1kPi1dZFh2wfA4GxGC6ccVm415SQpAT3T434=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J9OjGF8xVvMEblFRJKLq31zsS4zY1pknEDdmM5d7XjxJGxb8OVAkhJoYuQPeDkwip GuLXrxCTIsWGv/MXo9itWOBccNCP8ayu9krE7xniRhz/pU1UJovBKSg1W2j7qwEBXT w2ptpEQv14yxjG1NJlWTjgnXVlI8LLhzI0YMn6cA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yiming Qian , Florian Westphal , Sasha Levin Subject: [PATCH 6.12 428/460] netfilter: bpf: defer hook memory release until rcu readers are done Date: Mon, 23 Mar 2026 14:47:04 +0100 Message-ID: <20260323134537.069965692@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134526.647552166@linuxfoundation.org> References: <20260323134526.647552166@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Florian Westphal [ Upstream commit 24f90fa3994b992d1a09003a3db2599330a5232a ] Yiming Qian reports UaF when concurrent process is dumping hooks via nfnetlink_hooks: BUG: KASAN: slab-use-after-free in nfnl_hook_dump_one.isra.0+0xe71/0x10f0 Read of size 8 at addr ffff888003edbf88 by task poc/79 Call Trace: nfnl_hook_dump_one.isra.0+0xe71/0x10f0 netlink_dump+0x554/0x12b0 nfnl_hook_get+0x176/0x230 [..] Defer release until after concurrent readers have completed. Reported-by: Yiming Qian Fixes: 84601d6ee68a ("bpf: add bpf_link support for BPF_NETFILTER programs") Signed-off-by: Florian Westphal Signed-off-by: Sasha Levin --- net/netfilter/nf_bpf_link.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_bpf_link.c b/net/netfilter/nf_bpf_link.c index b5e4ca9026a8e..be5e8bd90a3eb 100644 --- a/net/netfilter/nf_bpf_link.c +++ b/net/netfilter/nf_bpf_link.c @@ -170,7 +170,7 @@ static int bpf_nf_link_update(struct bpf_link *link, struct bpf_prog *new_prog, static const struct bpf_link_ops bpf_nf_link_lops = { .release = bpf_nf_link_release, - .dealloc = bpf_nf_link_dealloc, + .dealloc_deferred = bpf_nf_link_dealloc, .detach = bpf_nf_link_detach, .show_fdinfo = bpf_nf_link_show_info, .fill_link_info = bpf_nf_link_fill_link_info, -- 2.51.0