[PATCH v4 00/16] lib: find and fix possible string overflows
Stephen Hemminger
stephen at networkplumber.org
Sat Dec 6 19:43:01 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.
v4 - fix build on 32 bit and windows
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 | 23 ++++--
lib/eal/freebsd/eal.c | 6 +-
lib/eal/linux/eal.c | 6 +-
lib/eal/linux/eal_hugepage_info.c | 98 ++++++++++++--------------
lib/eal/linux/eal_memalloc.c | 11 ++-
lib/eal/linux/eal_memory.c | 9 ++-
lib/eal/windows/eal.c | 6 +-
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 | 14 +++-
lib/latencystats/rte_latencystats.c | 9 ++-
lib/lpm/rte_lpm.c | 25 +++++--
lib/lpm/rte_lpm.h | 2 +-
lib/meson.build | 4 --
lib/vhost/vhost.c | 14 ++--
24 files changed, 303 insertions(+), 153 deletions(-)
--
2.51.0
More information about the dev
mailing list