🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23273

[PATCH v2 nf 0/5] netfilter: pin file with get_file_active before reading f_cred

#23273
From: Tristan Madani
Date: Fri, 27 Nov 2026 00:16
41 lines
12524 bytes
From: Tristan Madani <tristan@talencesecurity.com>

Five netfilter callsites read file->f_cred through the
sk->sk_socket->file chain under RCU without pinning the file reference.
Since commit 0ede61d8589c ("file: convert to SLAB_TYPESAFE_BY_RCU"),
the file slab slot can be freed and reallocated within an RCU grace
period, so these readers may observe stale credential data from a
recycled file object.

This series pins the file with get_file_active() before reading f_cred
and releases it with fput() afterwards, matching the pattern used by
the recently merged cls_flow fix (commit 59cf9e6f48e5a).

Changes in v2:
 - Switch from get_file_rcu() to get_file_active() per API change
   (get_file_rcu was removed; get_file_active is the current API)
 - Reference merged cls_flow fix (59cf9e6f48e5a) which uses the
   same pattern for the same bug class

Tristan Madani (5):
  netfilter: xt_owner: pin file with get_file_active before reading
    f_cred
  netfilter: nft_meta: pin file with get_file_active before reading
    f_cred
  netfilter: nfnetlink_log: pin file with get_file_active before reading
    f_cred
  netfilter: nfnetlink_queue: pin file with get_file_active before
    reading f_cred
  netfilter: nf_log_syslog: pin file with get_file_active before reading
    f_cred

 net/netfilter/nf_log_syslog.c   | 28 +++++++++++++-------------
 net/netfilter/nfnetlink_log.c   | 35 ++++++++++++++++-----------------
 net/netfilter/nfnetlink_queue.c | 35 ++++++++++++++++-----------------
 net/netfilter/nft_meta.c        | 16 +++++++--------
 net/netfilter/xt_owner.c        | 27 ++++++++++++++-----------
 5 files changed, 72 insertions(+), 69 deletions(-)

-- 
2.47.3
Technical Details
Message-ID: <20261127001637.1026589-1-tristmd@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372389-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372389-linux-kernel-netdev=dewy.ru
From: tristmd@gmail.com (Tristan Madani)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v2 nf 0/5] netfilter: pin file with get_file_active before reading f_cred
Date: Fri, 27 Nov 2026 00:16:32 +0000
Organization: Usenet Network
Message-ID: <20261127001637.1026589-1-tristmd@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="600017"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Y7AroN3w7qNvoEkkGN4wjOfRRcI= sha256:dN6mfppgvBv6XbQ30UxdBi4tW4wpr9cxYXnZoZI5cCY=
	sha1:MYCbTg9+4l+xq3yP2LTIoA+ocJ0= sha256:IWT6Yl9L4DXugy5d95m+y7GrWm9acwUeZPu8ZaAapuA=
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 E8EA7125F0E; Fri, 27 Nov 2026 03:17:17 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	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=gmail.com
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 v1_PQi-PTbDe;
	Fri, 27 Nov 2026 03:17:11 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-372389-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 88A0F125F0C; Fri, 27 Nov 2026 03:17:01 +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 E512E393C4; Fri, 27 Nov 2026 00:16:50 +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=1795738609;
	b=TDeYOC9wS3TLqHgSn3R/zeU35MF69eMUwZUK1fvOZuRHOsCGLqClos/Dgde8okUFocza
	 Ug8YgdGC2KnwNy44Ui1lmlFEvZb5srsA182/L7Zj45NDfbGaREty0cwMPzhLjy/3Wlnwz
	 k60D8cD+3J3d/aL4PixiiK+dAd12BQUM3uvyqc9stkoPROw4HFCxunKl5fOW/LWVLZ13M
	 ZFTkfLRbA6QH1Drp5N/s5Lv3zgiQAKcm5InvtcOZ8xIeIHpKUtPyWUWnp6JFOqSBPSmPt
	 1Lqzb2nsxo3e3q4mlzPcc7bIjIyt+IYjMXspSeo4fSuo8GbXPkf8K/OgxSbHcnVQUXQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795738609;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=DaucjX7EGKxhjPytfA6PE6Q1xmcvizrq4bihC56pvSM=;
	b=PN1onwFoUJHeHjlD0lADo5dlONUnqYVJHeplIsKJLSFxBOLcxqoEzG1vb/kC470EGzN+
	 hIT6hquRfnteftTDzcDfEIh9BmSiI+Yv451VAa45/iKu45+zyJ1yK15ieO7ROSzJOKjeE
	 iDrraWS/WeV88NXD/pJesecowixcd4UqQFufYja5HhfQcmNPP+fUOSUIEuuFVV8PpAJPt
	 HcQYcQFP9iDK0sGSsoI9MTwmerlzGEp98CTLPh8A2Vk5Xxb+CEPXbijR2sH9kxp6NQrTp
	 wBHWwrR9JzbGWZpGmy//lyVIOd98+b+qWko65tQCf5S5eBJ/kD3Em4hzABlQoSw/DuA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lwLIWbsQ;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 C2EDA606A681;
	Fri, 27 Nov 2026 00:16:49 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lwLIWbsQ
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.53
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795738609;
	b=pGSbyv0PUMLDPG53O2D+ww4wGq9x37lox1IUYa9SWoD5iC+EnKQxgx7/m+2bOWpQSUwK
	 NoVJRE/dQqNRNUO9fpgYgAdvL8xFseut7Zm3fWhv7byatsZuYV9zzYkojJ1HEBlm+KukE
	 1QPnP3kWj1vCH73cYZtB+PvB+QV8Cg/jogz/4JnjMNx3drax9tGOZxShWdHCW7CAgmJjV
	 hCEbVlgMt6jeE5vIcXsScFSSxoUA9ikt/vQ5iFE0FwJdi3k7U5IYu7DDECM7shZrdHD76
	 5GoyGJOFDU3LnyljucBGFAgQOc5U8ndI4YkFxQ6JRbOyX1mK6UqH52tIW4oKZ/fgHyA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795738609;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
	 Content-Transfer-Encoding;
	bh=DaucjX7EGKxhjPytfA6PE6Q1xmcvizrq4bihC56pvSM=;
	b=ivOXMOd02twXQxvwngJmE/bArrdXt022rgL5nd1K0ybhjjGCX0oXY6k0LJsEQnvwkFEo
	 2EhyCIW86d6bCUUaJgzQ9xcyBCY9wkoGdftkS/SHhtDFkvXenTd8A1of61iTPXBg8H4Hw
	 VLVZZWZAx5QL0o69dbRZn4NeVBM2J7Ji68td2Z8A0NbBpww9pzKhlnqVkhIR2fmusTKBN
	 Rp6no+k6mnjDosMWRhCvUFxeCYKiUT8GYBsl3oFvjigsmlE3LMbsIt9gE62R43VtUxsxW
	 +zXEIE/23XBctJy4au1DVgnQmzQxVuZLN0PLbUYRsbHq4ZXNkKz7MKooiIYYuj4548Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lwLIWbsQ;
	arc=none smtp.remote-ip=209.85.128.53
X-Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D3D9606A323
	for <netdev@vger.kernel.org>; Fri, 27 Nov 2026 00:16:48 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8D3D9606A323
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4bb9d8e8e90so46687795e9.3
        for <netdev@vger.kernel.org>; Thu, 26 Nov 2026 16:16:48 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795738607; x=1796343407; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=DaucjX7EGKxhjPytfA6PE6Q1xmcvizrq4bihC56pvSM=;
        b=lwLIWbsQhHcHN3CDna52sVsq9gSO9DJklq6bzGLe3Els2E42gC4pjSTwi8CBXWLj69
         Y6xmDtc6vsito++1VpPJRTsurb0wgyvDhyMIg+LD/l26p52SEGOkBsnM4H/sadwjMOqP
         yqZVtUrGQauUYqpHZDGlRuUHH2sCLzuOyxWAaDjFw2nfdIdTw3taHA64sqf7Z8bP4d13
         8Z/U3f1HmgsK3yj/WRRhDbndUus2MBgUPvB2KPMI6ZVKHsF+COYApylXIc+drZgLM/Bk
         Ed4rW/K8emw3n7dCq2ap1AUGQmklHOyJbD33q+73qeC/NDNq5fnm2CwdYHjz+hEdCPim
         22Qg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795738607; x=1796343407;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=DaucjX7EGKxhjPytfA6PE6Q1xmcvizrq4bihC56pvSM=;
        b=lnH2Moe+uJIm9Hgmpa/9OHdXAc1yOlBoOqBvtqQtGz5QJWy9YA9MOHDu8sMTKsRnPH
         fhbmZUAEjtJ2RPZhc5NSxZngcoq6vtzkRT7ao8Xuh2IozSKnfPxuZSazJH67teVsA9hP
         n10fxq9IUkpl+Km5b2GxezDi5+f0D6PTRI3cQlhqOjwagwVtYYJ8U6dF1vFo8UQeiOMy
         p+UlO61WzOQ9MJadVEhJRVfbTONzaOsZscRaK3/RHO8NJQpH2IQ0JhSgdm4FkF3S6hof
         LvoLEcBGjBv2SZIS7mQIWxylke9CePA2ZGlMFqc/NHWkN1Mu/GV4uqJCN/po78ueXBKQ
         G0Cg==
X-Forwarded-Encrypted: i=1; AL+hErFWXx7It24ntCe+0YIIW4Yy91aV0RkpgeKfI3OyYii4fDdotjmC2jPKukEvCP7Qz0ThUEAxJX8=@vger.kernel.org
X-Gm-Message-State: APuU4Z+zY4lIRmfA0YUIv/lUtI2j7ExmVwkMD1nfTbvXTBV2tfmAgB9w
	cpuOJZMD84wWldtvTV6r1+sYJQ8Gxy0CKgTDjoGYM62LzFB5wQHv+6g=
X-Gm-Gg: AZFdTZdV8Pj0HqAg65HmfVKSK3phLcoyFw8DNdbojANnTW86noA1rQ7OYLf3PiZ1Q8H
	22XUWe2wxDcA1pFkxjryyjH18/RMjZhMltyyIgdaGNcYxOhib21tpjzdIfxlWEl+fc7UJjPN8R0
	FYxCfCVJRKFsMT/OACTXMvgs9etwxu0m3CfSgOe3gc4iaEtmyaAgWkXBst3COTBI8TESsKuayxQ
	1jXHFIB8+qIqDDQs09lWqcmIYGBL0N08u6S1BRIzV7o7heOlulwy7cr9C0FRHOHPS0AdltfRAFM
	rztoGavQGs4c+ZFrxqJi8SAqmboQsfl1CFUrxCwJpU4uf5ZokcFGP8HeZ9d3D7YQJMzT/ld5NMr
	RIYqnHohxw4seN+uH5KUTS3rwwofCbAxD/9xQDZ+WBdJX8iUWEmweUSU4rDkl8F2hxazFcywmvT
	elFpaaNvV3NV35Rb+jserL/Qw+lpQ4h5xpa550W62p8GeU51mK+WkljEzufYakjxpEYZrBGJeL5
	UKapM2xj8C9pJ59B7lUlJf7xq7rwxId9la7YxIffvdOha8cv7Ng3yfiq595pxAro3so/iKkQXim
	F7RPSplDQ/uHkBs=
X-Received: by 2002:a05:600c:3f0a:b0:4a5:75d2:c104 with SMTP id 5b1f17b1804b1-4bb8880cde7mr439388735e9.22.1795738606729;
        Thu, 26 Nov 2026 16:16:46 -0800 (PST)
X-Received: from localhost.localdomain ([2001:41d0:303:db6b::])
        by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb906d6a13sm356650865e9.3.2026.11.26.16.16.46
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Thu, 26 Nov 2026 16:16:46 -0800 (PST)
X-Cc: Phil Sutter <phil@nwl.cc>,
	Christian Brauner <brauner@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	coreteam@netfilter.org,
	netfilter-devel@vger.kernel.org,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	stable@vger.kernel.org,
	Tristan Madani <tristan@talencesecurity.com>
X-Mailer: git-send-email 2.47.3
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