All of lore.kernel.org
 help / color / mirror / Atom feed
* [iptables PATCH 0/4] Fix for iptables-nft-restore under pressure
@ 2020-03-02 17:53 Phil Sutter
  2020-03-02 17:53 ` [iptables PATCH 1/4] nft: cache: Fix nft_release_cache() under stress Phil Sutter
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Phil Sutter @ 2020-03-02 17:53 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: netfilter-devel

Using a rather simple test-case, it is possible to provoke NULL-pointer
derefs in iptables-nft-restore.

Said test-case involves a rule set with a thousand custom chains in each
table, a thousand rules in each builtin chain and one rule in each
custom chain - details are not important though, it is enough to have
reasonably large tables to cause delays.

The test script simply starts ten instances of iptables-nft-restore in
background and ten instances in a loop in foreground, all reading above
rule set.

Critical detail is iptables-nft-restore pushing to kernel at each COMMIT
line, so nft_rebuild_cache() may run multiple times during a single
restore.

The actual fix is contained in patch one. Patch two is actually a
performance optimization, the behaviour it changes is not wrong per se.
Patches three and four are fall-out from the first one.

Phil Sutter (4):
  nft: cache: Fix nft_release_cache() under stress
  nft: cache: Make nft_rebuild_cache() respect fake cache
  nft: cache: Simplify chain list allocation
  nft: cache: Review flush_cache()

 iptables/nft-cache.c | 87 +++++++++++++++++++++++---------------------
 iptables/nft.h       |  3 +-
 2 files changed, 48 insertions(+), 42 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2020-03-04 17:02 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-02 17:53 [iptables PATCH 0/4] Fix for iptables-nft-restore under pressure Phil Sutter
2020-03-02 17:53 ` [iptables PATCH 1/4] nft: cache: Fix nft_release_cache() under stress Phil Sutter
2020-03-02 19:19   ` Pablo Neira Ayuso
2020-03-03  1:02     ` Phil Sutter
2020-03-03 20:55       ` Pablo Neira Ayuso
2020-03-04  2:13         ` Phil Sutter
2020-03-04 17:02           ` Pablo Neira Ayuso
2020-03-02 17:53 ` [iptables PATCH 2/4] nft: cache: Make nft_rebuild_cache() respect fake cache Phil Sutter
2020-03-02 19:26   ` Pablo Neira Ayuso
2020-03-03  1:15     ` Phil Sutter
2020-03-02 17:53 ` [iptables PATCH 3/4] nft: cache: Simplify chain list allocation Phil Sutter
2020-03-02 17:53 ` [iptables PATCH 4/4] nft: cache: Review flush_cache() Phil Sutter
2020-03-02 19:22   ` Pablo Neira Ayuso
2020-03-03  1:22     ` Phil Sutter

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.