Netdev List
 help / color / mirror / Atom feed
* [PATCH v2 nf 0/5] netfilter: pin file with get_file_active before reading f_cred
@ 2026-11-27  0:16 Tristan Madani
  2026-11-27  0:16 ` [PATCH v2 nf 1/5] netfilter: xt_owner: " Tristan Madani
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tristan Madani @ 2026-11-27  0:16 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Florian Westphal
  Cc: Phil Sutter, Christian Brauner, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, coreteam,
	netfilter-devel, netdev, linux-kernel, stable, Tristan Madani

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-27  0:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27  0:16 [PATCH v2 nf 0/5] netfilter: pin file with get_file_active before reading f_cred Tristan Madani
2026-11-27  0:16 ` [PATCH v2 nf 1/5] netfilter: xt_owner: " Tristan Madani
2026-11-27  0:16 ` [PATCH v2 nf 2/5] netfilter: nft_meta: " Tristan Madani
2026-11-27  0:16 ` [PATCH v2 nf 3/5] netfilter: nfnetlink_log: " Tristan Madani
2026-11-27  0:16 ` [PATCH v2 nf 4/5] netfilter: nfnetlink_queue: " Tristan Madani
2026-11-27  0:16 ` [PATCH v2 nf 5/5] netfilter: nf_log_syslog: " Tristan Madani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox