All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf-next 0/6] add refcount to ct timeout/helper
@ 2026-05-26 16:40 Pablo Neira Ayuso
  2026-05-26 16:40 ` [PATCH nf-next 1/6] netfilter: nfnetlink_cthelper: use {READ,WRITE}_ONCE for accessing helper flags Pablo Neira Ayuso
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Pablo Neira Ayuso @ 2026-05-26 16:40 UTC (permalink / raw)
  To: netfilter-devel; +Cc: fw

Hi,

This is change in the direction of the original series..

This series reworks the ct timeout/helper infrastructure to add a
refcount for tracking the use of these objects from the ct extension
area.

This is to address the existing races with unconfirmed conntracks that
could sit in the nfqueue (or elsewhere) leading to access to stale
pointer on reinject if ct timeout/helper goes away. Also module removal
could lead to issues.

The idea in this series is to dynamically allocation the ct helper and
timeout so the memory areas are released when the last use on them is
dropped via refcounting.

Patch #1 adds the {READ,WRITE}_ONCE notation to nfnetlink_cthelper.
Patch #2 adds refcounting to the ct timeout policy.
Patch #3 is a preparation patch which moves the ct helper from BSS
         to slab.
Patch #4 move GRE PPTP destroy so removal of .destroy so this stays
         around on removal.
Patch #5 add the refcounting to the ct helper datapath.
Patch #6 revert the ct extension genid and the nf_ct_iterate_destroy()
         now that refcounting tracks use of these ct extensions.

Comments welcome.

Thanks.

Pablo Neira Ayuso (6):
  netfilter: nfnetlink_cthelper: use {READ,WRITE}_ONCE for accessing helper flags
  netfilter: cttimeout: detach dataplane timeout policy and add refcount
  netfilter: nf_conntrack_helper: dynamically allocate struct nf_conntrack_helper
  netfilter: nf_conntrack_pptp: move GRE specific cleanup to GRE tracker
  netfilter: nf_conntrack_helper: add refcounting from datapath
  netfilter: conntrack: revert ct extension genid infrastructure

 .../net/netfilter/ipv4/nf_conntrack_ipv4.h    |   4 +
 include/net/netfilter/nf_conntrack.h          |   6 +-
 include/net/netfilter/nf_conntrack_extend.h   |  12 --
 include/net/netfilter/nf_conntrack_helper.h   |  41 ++++--
 include/net/netfilter/nf_conntrack_timeout.h  |  21 +++
 net/ipv4/netfilter/nf_nat_snmp_basic_main.c   |  19 ++-
 net/netfilter/nf_conntrack_amanda.c           |  39 ++----
 net/netfilter/nf_conntrack_core.c             | 130 ++----------------
 net/netfilter/nf_conntrack_extend.c           |  32 +----
 net/netfilter/nf_conntrack_ftp.c              |   5 +-
 net/netfilter/nf_conntrack_h323_main.c        |  91 +++++-------
 net/netfilter/nf_conntrack_helper.c           |  97 ++++++++-----
 net/netfilter/nf_conntrack_irc.c              |   5 +-
 net/netfilter/nf_conntrack_netbios_ns.c       |  18 ++-
 net/netfilter/nf_conntrack_netlink.c          |  12 +-
 net/netfilter/nf_conntrack_ovs.c              |  14 +-
 net/netfilter/nf_conntrack_pptp.c             |  87 ++----------
 net/netfilter/nf_conntrack_proto.c            |  15 +-
 net/netfilter/nf_conntrack_proto_gre.c        |  61 ++++++++
 net/netfilter/nf_conntrack_sane.c             |   5 +-
 net/netfilter/nf_conntrack_sip.c              |   5 +-
 net/netfilter/nf_conntrack_snmp.c             |  21 ++-
 net/netfilter/nf_conntrack_tftp.c             |   5 +-
 net/netfilter/nf_conntrack_timeout.c          |  20 ++-
 net/netfilter/nf_nat_core.c                   |  15 +-
 net/netfilter/nfnetlink_cthelper.c            |  40 +++---
 net/netfilter/nfnetlink_cttimeout.c           |  75 +++++-----
 net/netfilter/nft_ct.c                        |   7 +-
 net/netfilter/xt_CT.c                         |   7 +-
 29 files changed, 418 insertions(+), 491 deletions(-)

-- 
2.47.3


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

end of thread, other threads:[~2026-05-27 13:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 16:40 [PATCH nf-next 0/6] add refcount to ct timeout/helper Pablo Neira Ayuso
2026-05-26 16:40 ` [PATCH nf-next 1/6] netfilter: nfnetlink_cthelper: use {READ,WRITE}_ONCE for accessing helper flags Pablo Neira Ayuso
2026-05-26 16:40 ` [PATCH nf-next 2/6] netfilter: cttimeout: detach dataplane timeout policy and add refcount Pablo Neira Ayuso
2026-05-26 16:40 ` [PATCH nf-next 3/6] netfilter: nf_conntrack_helper: dynamically allocate struct nf_conntrack_helper Pablo Neira Ayuso
2026-05-26 16:40 ` [PATCH nf-next 4/6] netfilter: nf_conntrack_pptp: move GRE specific cleanup to GRE tracker Pablo Neira Ayuso
2026-05-26 16:40 ` [PATCH nf-next 5/6] netfilter: nf_conntrack_helper: add refcounting from datapath Pablo Neira Ayuso
2026-05-26 17:54   ` Florian Westphal
2026-05-26 22:19     ` Pablo Neira Ayuso
2026-05-27 13:39       ` Florian Westphal
2026-05-26 16:40 ` [PATCH nf-next 6/6] netfilter: conntrack: revert ct extension genid infrastructure Pablo Neira Ayuso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.