Fix for iptables-nft-restore under pressure
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest4 patches 9 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | nft: cache: Fix nft_release_cache() under stressiptables/ | +8 | 5 replies | |
| 2/4 | nft: cache: Make nft_rebuild_cache() respect fake cacheiptables/ iptables/ | +10 | 2 replies | |
| 3/4 | nft: cache: Simplify chain list allocationiptables/ | +19 | 0 replies | |
| 4/4 | nft: cache: Review flush_cache()iptables/ | +11 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [iptables PATCH 0/4] Fix for iptables-nft-restore under pressure
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(-)
Signature · 1 line
2.25.1