netfilter: refactor deprecated strncpy
Get series with b4
b4 am [email protected] change-id 20230807-net-netfilter-4027219bb6e7Versions newest first
- v2 Latest7 patches 9 repliesIn review
- v17 patches 8 repliesSuperseded
Changes in v2 from the cover letter
- use strscpy_pad instead of strscpy since zero-padding is needed (thanks Florian and Kees)
- Link to v1: https://lore.kernel.org/r/[email protected]
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | netfilter: ipset: refactor deprecated strncpynet/ | +5 | 6 replies | |
| 2/7 | netfilter: nf_tables: refactor deprecated strncpynet/ | +1 | 0 replies | |
| 3/7 | netfilter: nf_tables: refactor deprecated strncpynet/ | +1 | 0 replies | |
| 4/7 | netfilter: nft_meta: refactor deprecated strncpynet/ | +3 | 0 replies | |
| 5/7 | netfilter: nft_osf: refactor deprecated strncpynet/ | +3 | 1 reply | |
| 6/7 | netfilter: x_tables: refactor deprecated strncpynet/ | +2 | 1 reply | |
| 7/7 | netfilter: xtables: refactor deprecated strncpynet/ | +1 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/7] netfilter: refactor deprecated strncpy
strncpy is deprecated for use on NUL-terminated destination strings [1].
A suitable replacement is strscpy or strscpy_pad [2] due to the fact that they guarantee NUL-termination on their destination buffer argument which is _not_ the case for strncpy!
This series of patches aims to swap out strncpy for more a robust and less ambiguous interface strscpy_pad . This patch series, if applied in its entirety, removes most if not all instances of strncpy in the net/netfilter directory.
[1]: www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [2]: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html
Related: commit 8556bceb9c40 ("netfilter: move from strlcpy with unused retval to strscpy")
---
Changes in v2:
- use strscpy_pad instead of strscpy since zero-padding is needed (thanks Florian and Kees)
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Justin Stitt (7):
netfilter: ipset: refactor deprecated strncpy
netfilter: nf_tables: refactor deprecated strncpy
netfilter: nf_tables: refactor deprecated strncpy
netfilter: nft_meta: refactor deprecated strncpy
netfilter: nft_osf: refactor deprecated strncpy
netfilter: x_tables: refactor deprecated strncpy
netfilter: xtables: refactor deprecated strncpy
net/netfilter/ipset/ip_set_core.c | 10 +++++----- net/netfilter/nft_ct.c | 2 +- net/netfilter/nft_fib.c | 2 +- net/netfilter/nft_meta.c | 6 +++--- net/netfilter/nft_osf.c | 6 +++--- net/netfilter/x_tables.c | 5 ++--- net/netfilter/xt_repldata.h | 2 +- 7 files changed, 16 insertions(+), 17 deletions(-)
---
base-commit: 14f9643dc90adea074a0ffb7a17d337eafc6a5cc
change-id: 20230807-net-netfilter-4027219bb6e7
Best regards,
--
Justin Stitt <[email protected]>