Skip to content

add hardening checks to cmdline and cfgfile libs

Bruce Richardson dpdk-dev 1 version Applied

Status from this message: Applied, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/6cfgfile: add null checks to public APIslib/cfgfile/rte_cfgfile.c+34 -10 replies
2/6cfgfile: prevent issues with overflow on resizelib/cfgfile/rte_cfgfile.c+49 -380 replies
3/6cmdline: harden parser result buffer handlinglib/cmdline/cmdline_parse.c lib/cmdline/cmdline_parse_bool.c+20 -50 replies
4/6cmdline: add explicit help function for bool typelib/cmdline/cmdline_parse_bool.c+17 -10 replies
5/6cmdline: guard zero-size destination bufferslib/cmdline/cmdline_parse_num.c lib/cmdline/cmdline_parse_string.c+4 -10 replies
6/6cmdline: add null checks for invalid inputlib/cmdline/cmdline.c lib/cmdline/cmdline_rdline.c+6 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/6] add hardening checks to cmdline and cfgfile libs

Using AI tools to review the cmdline and cfgfile libraries throws up a couple of places in the libraries where additional hardening could help prevent future issues. A number of these are purely defensive, e.g. adding NULL checks to input parameters where a well-behaved app should never call the function with a NULL value, and so those are not explicitly marked for backport.

Bruce Richardson (6):
cfgfile: add null checks to public APIs
cfgfile: prevent issues with overflow on resize
cmdline: harden parser result buffer handling
cmdline: add explicit help function for bool type
cmdline: guard zero-size destination buffers
cmdline: add null checks for invalid input

 lib/cfgfile/rte_cfgfile.c          | 118 ++++++++++++++++++++---------
 lib/cmdline/cmdline.c              |   3 +
 lib/cmdline/cmdline_parse.c        |   6 +-
 lib/cmdline/cmdline_parse_bool.c   |  37 ++++++++-
 lib/cmdline/cmdline_parse_num.c    |   2 +-
 lib/cmdline/cmdline_parse_string.c |   3 +
 lib/cmdline/cmdline_rdline.c       |   3 +
 7 files changed, 128 insertions(+), 44 deletions(-)

--
2.51.0