Linux Netfilter development
 help / color / mirror / Atom feed
* [PATCH nft 0/3] src: make set-merging less zealous
@ 2023-12-13 17:06 Florian Westphal
  2023-12-13 17:06 ` [PATCH nft 1/3] intervals: BUG on prefix expressions without value Florian Westphal
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Florian Westphal @ 2023-12-13 17:06 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

I got a large corpus of various crashes in the set internals code
tripping over expressions that should not exist, e.g. a range expression
with a symbolic expression.

From initial investigation it looks like to root cause is the same,
we have back-to-back declarations of the same set name, evaluation
is returning errors, but we instist to continue evaluation.

Then, we try to merge set elements and end up merging
such a 'redefined set' with an erroneous one.

This series adds an initial assertion which helped to make
crashes easier to backtrace.

Second patch adds a 'errors' flag to struct set and raises
it once we saw soemthing funky.

Patch 3 also sets/uses this when evaluating the set itself.

Alternative would be to make the lowlevel code more robust
of these kinds of issues, but that might take a while
to fix, also because this oce is partially not able to
indicate errors.

Florian Westphal (3):
  intervals: BUG on prefix expressions without value
  src: do not merge a set with a erroneous one
  evaluate: don't assert if set->data is NULL

 include/rule.h                                  |  2 ++
 src/evaluate.c                                  | 17 +++++++++++++++--
 src/intervals.c                                 |  5 ++++-
 .../nft-f/expr_evaluate_mapping_no_data_assert  |  4 ++++
 .../bogons/nft-f/invalid_range_expr_type_binop  | 12 ++++++++++++
 5 files changed, 37 insertions(+), 3 deletions(-)
 create mode 100644 tests/shell/testcases/bogons/nft-f/expr_evaluate_mapping_no_data_assert
 create mode 100644 tests/shell/testcases/bogons/nft-f/invalid_range_expr_type_binop

-- 
2.41.0


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

end of thread, other threads:[~2023-12-16 10:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-13 17:06 [PATCH nft 0/3] src: make set-merging less zealous Florian Westphal
2023-12-13 17:06 ` [PATCH nft 1/3] intervals: BUG on prefix expressions without value Florian Westphal
2023-12-13 17:06 ` [PATCH nft 2/3] src: do not merge a set with a erroneous one Florian Westphal
2023-12-13 17:06 ` [PATCH nft 3/3] evaluate: don't assert if set->data is NULL Florian Westphal
2023-12-16 10:11 ` [PATCH nft 0/3] src: make set-merging less zealous Florian Westphal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox