Skip to content

misc LLM fixes

Florian Westphal netfilter-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7include: str_array.h: avoid oob readinclude/str_array.h+4 -40 replies
2/7src: chain: fix NFTNL_CHAIN_TYPE data_lensrc/chain.c+1 -10 replies
3/7src: common: fix fd leak in nftnl_batch_is_supportedsrc/common.c+4 -10 replies
4/7expr: nftnl_expr_parse: use nftnl_expr_free on error unwindsrc/expr.c+1 -10 replies
5/7src: flowtable: allow to unset NFTNL_FLOWTABLE_SIZEsrc/flowtable.c+1 -00 replies
6/7src: utils: keep old name if strndup failssrc/utils.c+13 -110 replies
7/7src: add and use nftnl_mem_blob for user_datainclude/obj.h include/rule.h include/set.h +9 more+98 -1200 replies

Reviews trailers per patch

None of the 7 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchFernando Fernandez Mancera
SeriesR-b
1/7
2/7
3/7
4/7
5/7
6/7
7/7

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 libnftnl 0/7] misc LLM fixes

The only thing these changes have in common is that they are all LLM findings.

1) Prevent out-of-bounds read in str_array.h, this doesn't cause crash, the value that is read off the end of the array is not used.

2) Fix NFTNL_CHAIN_TYPE data_len to return the string length, consistent with other attributes.

3) Fix fd leak in nftnl_batch_is_supported when mnl_socket_bind() fails. Close the already-open socket on the error path.

4) Free partially-allocated sub-objects in nftnl_expr_parse error path via nftnl_expr_free. Fixes memory leaks (e.g., dynset set_name) when parsing embedded expressions fails after allocation.

5) Allow unsetting NFTNL_FLOWTABLE_SIZE.

6) Fix pointer state inconsistency by freeing the old value only after strndup succeeds. Delegate nftnl_parse_str_attr to the fixed helper instead of open-coding the same bug.

7) Add nftnl_mem_blob helper for user_data and switch all users to it, resolving inconsistent state on alloc failure.

Florian Westphal (7):
include: str_array.h: avoid oob read
src: chain: fix NFTNL_CHAIN_TYPE data_len
src: common: fix fd leak in nftnl_batch_is_supported
expr: nftnl_expr_parse: use nftnl_expr_free on error unwind
src: flowtable: allow to unset NFTNL_FLOWTABLE_SIZE
src: utils: keep old name if strndup fails
src: add and use nftnl_mem_blob for user_data

 include/obj.h       |  5 +----
 include/rule.h      |  5 +----
 include/set.h       |  5 +----
 include/set_elem.h  |  6 ++----
 include/str_array.h |  8 ++++----
 include/utils.h     | 24 ++++++++++++++++++++++++
 src/chain.c         | 25 ++++++++-----------------
 src/common.c        |  5 ++++-
 src/expr.c          |  2 +-
 src/flowtable.c     |  1 +
 src/object.c        | 18 ++++++------------
 src/rule.c          | 41 +++++++++++++----------------------------
 src/set.c           | 18 ++++++------------
 src/set_elem.c      | 31 +++++++++++--------------------
 src/table.c         | 23 +++++++----------------
 src/utils.c         | 43 ++++++++++++++++++++++++++++++++-----------
 16 files changed, 122 insertions(+), 138 deletions(-)
Signature · 1 line
2.55.0