Netdev List
 help / color / mirror / Atom feed
* [PATCH nf 0/5] netfilter: pin file with get_file_rcu() before reading f_cred
@ 2026-10-13 23:43 Tristan Madani
  2026-10-13 23:43 ` [PATCH nf 1/5] netfilter: xt_owner: " Tristan Madani
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Tristan Madani @ 2026-10-13 23:43 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, netfilter-devel,
	coreteam, netdev, Tristan Madani

From: Tristan Madani <tristan@talencesecurity.com>

Since commit 0ede61d8589cc ("file: convert to SLAB_TYPESAFE_BY_RCU"),
struct file objects can have their slab slot reused while RCU readers
still hold pointers to them.

Five netfilter locations read file->f_cred through a stored sock->file
pointer under RCU without pinning the file. If the slab slot is
reused between the pointer read and the credential dereference, the
check operates on stale or unrelated credential data.

Pin the file with get_file_rcu() and release with fput() on all paths.

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

 net/netfilter/nf_log_syslog.c   | 19 ++++++++++++-------
 net/netfilter/nfnetlink_log.c   | 17 +++++++++++------
 net/netfilter/nfnetlink_queue.c | 17 +++++++++++------
 net/netfilter/nft_meta.c        | 19 ++++++++++++-------
 net/netfilter/xt_owner.c        | 27 +++++++++++++++---------
 5 files changed, 64 insertions(+), 35 deletions(-)

-- 
2.47.3

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

end of thread, other threads:[~2026-10-13 23:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 23:43 [PATCH nf 0/5] netfilter: pin file with get_file_rcu() before reading f_cred Tristan Madani
2026-10-13 23:43 ` [PATCH nf 1/5] netfilter: xt_owner: " Tristan Madani
2026-10-13 23:43 ` [PATCH nf 2/5] netfilter: nft_meta: " Tristan Madani
2026-10-13 23:43 ` [PATCH nf 3/5] netfilter: nfnetlink_log: " Tristan Madani
2026-10-13 23:43 ` [PATCH nf 4/5] netfilter: nfnetlink_queue: " Tristan Madani
2026-10-13 23:43 ` [PATCH nf 5/5] netfilter: nf_log_syslog: " Tristan Madani
2026-10-13 23:50 ` [PATCH nf 0/5] netfilter: " netdev-bot+sinfo

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