[RFC v2 00/14] lib: check for string overflow

Stephen Hemminger
2025-12-05T02:29:55Z

First draft of changes to fix format overflow issues in EAL and
related libraries. This does introduce more restrictions on
file prefix and some parameters because of more checking
for overflow.

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

app/test/test_hash.c | 29 +++++++----
lib/eal/common/eal_common_config.c | 6 ++-
lib/eal/common/eal_common_memory.c | 2 +-
lib/eal/common/eal_common_proc.c | 83 +++++++++++++++++++-----------
lib/eal/common/eal_filesystem.h | 16 ++++--
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 | 15 +++++-
lib/ethdev/rte_ethdev.c | 28 +++++++---
lib/graph/graph_pcap.c | 9 ++--
lib/hash/rte_cuckoo_hash.c | 21 +++++---
lib/hash/rte_hash.h | 6 ++-
lib/lpm/rte_lpm.h | 2 +-
lib/meson.build | 4 --
lib/vhost/vhost.c | 14 +++--
17 files changed, 202 insertions(+), 123 deletions(-)

--
2.51.0