Skip to content

evaluate: fix crash on empty set restore

Florian Westphal netfilter-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3testcases: move two dump files to correct locationtests/shell/testcases/chains/dumps/0031priority_variable_0.nft tests/shell/testcases/chains/dumps/0035policy_variable_0.nft+0 -00 replies
2/3tests: add empty dynamic settests/shell/testcases/nft-f/0025empty_dynset_0 tests/shell/testcases/nft-f/dumps/0025empty_dynset_0.nft+28 -00 replies
3/3evaluate: do not crash if dynamic set has no statementssrc/evaluate.c+6 -40 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH nft 0/3] evaluate: fix crash on empty set restore

nft crashes when it restores an empty set.
First patch moves two dump files to the correct location. Those test cases now fail when the dump files are modified, as expected.

Second patch adds crash reproducer test case.
Third patch avoids iteration when no statements exist in the set.

Florian Westphal (3):
testcases: move two dump files to correct location
tests: add empty dynamic set
evaluate: do not crash if dynamic set has no statements

 src/evaluate.c                                   | 10 ++++++----
 .../dumps/0031priority_variable_0.nft}           |  0
 .../dumps/0035policy_variable_0.nft}             |  0
 tests/shell/testcases/nft-f/0025empty_dynset_0   | 16 ++++++++++++++++
 .../testcases/nft-f/dumps/0025empty_dynset_0.nft | 12 ++++++++++++
 5 files changed, 34 insertions(+), 4 deletions(-)
 rename tests/shell/testcases/{nft-f/dumps/0021priority_variable_0.nft => chains/dumps/0031priority_variable_0.nft} (100%)
 rename tests/shell/testcases/{nft-f/dumps/0025policy_variable_0.nft => chains/dumps/0035policy_variable_0.nft} (100%)
 create mode 100755 tests/shell/testcases/nft-f/0025empty_dynset_0
 create mode 100644 tests/shell/testcases/nft-f/dumps/0025empty_dynset_0.nft
Signature · 1 line
2.26.2