Skip to content

Netfilter stable fixes for 5.4

Pablo Neira Ayuso netfilter-devel oe-kbuild-all stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/26netfilter: nf_tables: pass context to nft_set_destroy()net/netfilter/nf_tables_api.c+5 -50 replies
2/26netfilter: nftables: rename set element data activation/deactivation functionsnet/netfilter/nf_tables_api.c+11 -110 replies
3/26netfilter: nf_tables: drop map element references from preparation phaseinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c net/netfilter/nft_set_bitmap.c +2 more+108 -190 replies
4/26netfilter: nft_set_rbtree: Switch to node list walk for overlap detectionnet/netfilter/nft_set_rbtree.c+198 -250 replies
5/26netfilter: nft_set_rbtree: fix null deref on element insertionnet/netfilter/nft_set_rbtree.c+13 -70 replies
6/26netfilter: nft_set_rbtree: fix overlap expiration walknet/netfilter/nft_set_rbtree.c+14 -60 replies
7/26netfilter: nf_tables: don't skip expired elements during walknet/netfilter/nf_tables_api.c net/netfilter/nft_set_hash.c net/netfilter/nft_set_rbtree.c+4 -40 replies
8/26netfilter: nf_tables: GC transaction API to avoid race with control planeinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+276 -100 replies
9/26netfilter: nf_tables: adapt set backend to use GC transaction APInet/netfilter/nft_set_hash.c net/netfilter/nft_set_rbtree.c+141 -760 replies
10/26netfilter: nft_set_hash: mark set element as dead when deleting from packet pathnet/netfilter/nft_set_hash.c+4 -20 replies
11/26netfilter: nf_tables: remove busy mark and gc batch APIinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+5 -1200 replies
12/26netfilter: nf_tables: fix GC transaction races with netns and netlink event exit pathnet/netfilter/nf_tables_api.c+25 -40 replies
13/26netfilter: nf_tables: GC transaction race with netns dismantlenet/netfilter/nf_tables_api.c+6 -10 replies
14/26netfilter: nf_tables: GC transaction race with abort pathnet/netfilter/nf_tables_api.c+6 -10 replies
15/26netfilter: nf_tables: use correct lock to protect gc_listnet/netfilter/nf_tables_api.c+2 -20 replies
16/26netfilter: nf_tables: defer gc run if previous batch is still pendinginclude/net/netfilter/nf_tables.h net/netfilter/nft_set_hash.c net/netfilter/nft_set_rbtree.c+11 -00 replies
17/26netfilter: nft_set_rbtree: skip sync GC for new elements in this transactionnet/netfilter/nft_set_rbtree.c+6 -20 replies
18/26netfilter: nft_set_rbtree: use read spinlock to avoid datapath contentionnet/netfilter/nft_set_rbtree.c+2 -40 replies
19/26netfilter: nft_set_hash: try later when GC hits EAGAIN on iterationnet/netfilter/nft_set_hash.c+3 -60 replies
20/26netfilter: nf_tables: fix memleak when more than 255 elements expiredinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+9 -30 replies
21/26netfilter: nf_tables: unregister flowtable hooks on netns exitnet/netfilter/nf_tables_api.c+13 -50 replies
22/26netfilter: nf_tables: double hook unregistration in netns pathnet/netfilter/nf_tables_api.c net/netfilter/nft_chain_filter.c+30 -70 replies
23/26netfilter: nftables: update table flags from the commit phaseinclude/net/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+22 -184 replies
24/26netfilter: nf_tables: fix table flag updatesinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+41 -250 replies
25/26netfilter: nf_tables: disable toggling dormant table state more than oncenet/netfilter/nf_tables_api.c+4 -00 replies
26/26netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4)net/netfilter/nf_tables_api.c+3 -00 replies

Reviews trailers per patch

1 of 26 patches has a Reviewed-by or Acked-by.

PatchStefano Brivio
1/26
2/26
3/26
4/26R-b
5/26
6/26
7/26
8/26
9/26
10/26
11/26
12/26
13/26
14/26
15/26
16/26
17/26
18/26
19/26
20/26
21/26
22/26
23/26
24/26
25/26
26/26

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH -stable,5.4 00/26] Netfilter stable fixes for 5.4

Hi Greg, Sasha,

The batch contains Netfilter fixes for -stable 5.4. This batch is targeting at garbage collection (GC) / set timeout fixes that address possible UaF and memleaks as well as assorted bugs.

I am using original commit IDs for reference:

1) 0c2a85edd143 ("netfilter: nf_tables: pass context to nft_set_destroy()")

2) f8bb7889af58 ("netfilter: nftables: rename set element data activation/deactivation functions")

3) 628bd3e49cba ("netfilter: nf_tables: drop map element references from preparation phase")

4) c9e6978e2725 ("netfilter: nft_set_rbtree: Switch to node list walk for overlap detection")

5) 61ae320a29b0 ("netfilter: nft_set_rbtree: fix null deref on element insertion")

6) f718863aca46 ("netfilter: nft_set_rbtree: fix overlap expiration walk")

7) 24138933b97b ("netfilter: nf_tables: don't skip expired elements during walk")

8) 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")

9) f6c383b8c31a ("netfilter: nf_tables: adapt set backend to use GC transaction API")

10) c92db3030492 ("netfilter: nft_set_hash: mark set element as dead when deleting from packet path")

11) a2dd0233cbc4 ("netfilter: nf_tables: remove busy mark and gc batch API")

12) 6a33d8b73dfa ("netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path")

13) 02c6c24402bf ("netfilter: nf_tables: GC transaction race with netns dismantle")

14) 720344340fb9 ("netfilter: nf_tables: GC transaction race with abort path")

15) 8357bc946a2a ("netfilter: nf_tables: use correct lock to protect gc_list")

16) 8e51830e29e1 ("netfilter: nf_tables: defer gc run if previous batch is still pending")

17) 2ee52ae94baa ("netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction")

18) 96b33300fba8 ("netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention")

19) b079155faae9 ("netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration")

20) cf5000a7787c ("netfilter: nf_tables: fix memleak when more than 255 elements expired")

21) 6069da443bf6 ("netfilter: nf_tables: unregister flowtable hooks on netns exit")

22) f9a43007d3f7 ("netfilter: nf_tables: double hook unregistration in netns path")

23) 0ce7cf4127f1 ("netfilter: nftables: update table flags from the commit phase")

24) 179d9ba5559a ("netfilter: nf_tables: fix table flag updates")

25) c9bd26513b3a ("netfilter: nf_tables: disable toggling dormant table state more than once")

26) ("netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4)") does not exist in any tree, but it is required to fix a bogus EBUSY error in 5.4. This bug was implicitly fixed by 3f0465a9ef02 ("netfilter: nf_tables: dynamically allocate hooks per net_device in flowtables").

Please apply,
Thanks.

Florian Westphal (4):
netfilter: nft_set_rbtree: fix null deref on element insertion
netfilter: nft_set_rbtree: fix overlap expiration walk
netfilter: nf_tables: don't skip expired elements during walk
netfilter: nf_tables: defer gc run if previous batch is still pending

Pablo Neira Ayuso (22):
netfilter: nf_tables: pass context to nft_set_destroy()
netfilter: nftables: rename set element data activation/deactivation functions
netfilter: nf_tables: drop map element references from preparation phase
netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
netfilter: nf_tables: GC transaction API to avoid race with control plane
netfilter: nf_tables: adapt set backend to use GC transaction API
netfilter: nft_set_hash: mark set element as dead when deleting from packet path
netfilter: nf_tables: remove busy mark and gc batch API
netfilter: nf_tables: fix GC transaction races with netns and netlink event exit path
netfilter: nf_tables: GC transaction race with netns dismantle
netfilter: nf_tables: GC transaction race with abort path
netfilter: nf_tables: use correct lock to protect gc_list
netfilter: nft_set_rbtree: skip sync GC for new elements in this transaction
netfilter: nft_set_rbtree: use read spinlock to avoid datapath contention
netfilter: nft_set_hash: try later when GC hits EAGAIN on iteration
netfilter: nf_tables: fix memleak when more than 255 elements expired
netfilter: nf_tables: unregister flowtable hooks on netns exit
netfilter: nf_tables: double hook unregistration in netns path
netfilter: nftables: update table flags from the commit phase
netfilter: nf_tables: fix table flag updates
netfilter: nf_tables: disable toggling dormant table state more than once
netfilter: nf_tables: bogus EBUSY when deleting flowtable after flush (for 5.4)

 include/net/netfilter/nf_tables.h        | 129 +++---
 include/uapi/linux/netfilter/nf_tables.h |   1 +
 net/netfilter/nf_tables_api.c            | 512 +++++++++++++++++++----
 net/netfilter/nft_chain_filter.c         |   3 +
 net/netfilter/nft_set_bitmap.c           |   5 +-
 net/netfilter/nft_set_hash.c             | 110 +++--
 net/netfilter/nft_set_rbtree.c           | 375 +++++++++++++----
 7 files changed, 867 insertions(+), 268 deletions(-)
Signature · 1 line
2.30.2