Skip to content

netfilter: nf_tables: Kill name length restrictions

Phil Sutter netfilter-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 1 replyIn review
  2. v25 patches 3 repliesSuperseded
  3. v15 patches 3 repliesSuperseded

Changes in v3 from the cover letter

- Added new patch 1.
- Patch 2 remains unchanged.
- Detailed changelog of remaining patches is found there.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6netfilter: nf_tables: No need to check chain existence when tracingnet/netfilter/nf_tables_trace.c+5 -80 replies
2/6networking: Introduce nla_strdup()include/net/netlink.h lib/nlattr.c+25 -00 replies
3/6netfilter: nf_tables: Allow table names of up to 255 charsinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c +1 more+40 -160 replies
4/6netfilter: nf_tables: Allow chain name of up to 255 charsinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c +1 more+54 -130 replies
5/6netfilter: nf_tables: Allow set names of up to 255 charsinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+16 -60 replies
6/6netfilter: nf_tables: Allow object names of up to 255 charsinclude/net/netfilter/nf_tables.h include/uapi/linux/netfilter/nf_tables.h net/netfilter/nf_tables_api.c+11 -40 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [nf-next PATCH v3 0/6] netfilter: nf_tables: Kill name length restrictions

The following series lifts the tight restriction on name length of tables, chains, sets and objects. This is done by allocating memory for names dynamically, so there is no added overhead when reducing the restriction to a mere sanity level of 255 characters.

The first patch removes a needless check discovered when discussing v2 of this patch set.

The second patch introduces nla_strdup() which aids in duplicating a string contained in a netlink attribute. It is used to replace the call to nla_strlcpy() when populating name fields.

I've tested the series manually by creating tables, chains, sets and counter objects with long names and automated by running the py and shell testsuites of nftables repo. Also, kmemleak did not find anything nftables related.

Changes since v2:
- Added new patch 1.
- Patch 2 remains unchanged.
- Detailed changelog of remaining patches is found there.

Phil Sutter (6):
netfilter: nf_tables: No need to check chain existence when tracing
networking: Introduce nla_strdup()
netfilter: nf_tables: Allow table names of up to 255 chars
netfilter: nf_tables: Allow chain name of up to 255 chars
netfilter: nf_tables: Allow set names of up to 255 chars
netfilter: nf_tables: Allow object names of up to 255 chars

 include/net/netfilter/nf_tables.h        |  10 +--
 include/net/netlink.h                    |   1 +
 include/uapi/linux/netfilter/nf_tables.h |   9 +--
 lib/nlattr.c                             |  24 +++++++
 net/netfilter/nf_tables_api.c            | 112 +++++++++++++++++++++++--------
 net/netfilter/nf_tables_trace.c          |  42 +++++++++---
 6 files changed, 151 insertions(+), 47 deletions(-)
Signature · 1 line
2.13.1