[PATCH v3 00/16] lib: find and fix possible string overflows

Stephen Hemminger stephen at networkplumber.org
Fri Dec 5 21:11:29 CET 2025


Change all the libraries to find and fix cases where a string
could overflow when formatting or using strclpy. This does provide
early indication of possible problems where the file prefix is too
long to fit in unix domain socket path, and where a hash table
is being requested that has a name too long.

v3 - allow longer hash names but warn if ring names get truncated
   - pickup some other places like latencystats and tailq
   - add release note
   - fix build on FreeBSD

Stephen Hemminger (16):
  eal: use C library to parse filesystem table
  lpm: restrict name size
  hash: add checks for hash name length
  graph: avoid overflowing comment buffer
  latencystats: add check for string overflow
  efd: handle possible name truncation
  eal: warn if thread name is truncated
  eal: avoid format overflow when handling addresses
  eal: add check for sysfs path overflow
  eal: limit maximum runtime directory and socket paths
  eal: check for hugefile path overflow
  eal: check tailq length
  eal: handle long shared library path
  ethdev: avoid possible overflow in xstat names
  vhost: check for overflow in xstat name
  lib: enable format overflow warnings

 app/test/test_hash.c                   | 21 +++++++
 doc/guides/rel_notes/release_26_03.rst |  3 +
 lib/eal/common/eal_common_config.c     |  6 +-
 lib/eal/common/eal_common_memory.c     |  2 +-
 lib/eal/common/eal_common_options.c    | 17 ++++--
 lib/eal/common/eal_common_proc.c       | 83 +++++++++++++++++---------
 lib/eal/common/eal_common_tailqs.c     |  5 ++
 lib/eal/common/eal_filesystem.h        | 17 ++++--
 lib/eal/linux/eal.c                    |  6 +-
 lib/eal/linux/eal_hugepage_info.c      | 64 +++++++-------------
 lib/eal/linux/eal_memalloc.c           | 11 +++-
 lib/eal/linux/eal_memory.c             |  9 ++-
 lib/efd/rte_efd.c                      |  7 ++-
 lib/ethdev/rte_ethdev.c                | 35 +++++++----
 lib/graph/graph_pcap.c                 |  9 ++-
 lib/hash/rte_cuckoo_hash.c             | 41 +++++++++----
 lib/hash/rte_fbk_hash.c                | 13 +++-
 lib/latencystats/rte_latencystats.c    |  9 ++-
 lib/lpm/rte_lpm.h                      |  2 +-
 lib/meson.build                        |  4 --
 lib/vhost/vhost.c                      | 14 +++--
 21 files changed, 248 insertions(+), 130 deletions(-)

-- 
2.51.0



More information about the dev mailing list