linux/tools/net/ynl
David Wei 511ea82e34 tools: ynl-gen: validate 0 len strings from kernel
[ Upstream commit 4720f9707c ]

Strings from the kernel are guaranteed to be null terminated and
ynl_attr_validate() checks for this. But it doesn't check if the string
has a len of 0, which would cause problems when trying to access
data[len - 1]. Fix this by checking that len is positive.

Signed-off-by: David Wei <dw@davidwei.uk>
Link: https://patch.msgid.link/20250503043050.861238-1-dw@davidwei.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-05-29 11:03:12 +02:00
..
generated tools: ynl: rename make hardclean -> distclean 2024-03-06 12:05:10 +00:00
lib tools: ynl-gen: validate 0 len strings from kernel 2025-05-29 11:03:12 +02:00
samples tools: ynl: error check scanf() in a sample 2024-08-29 12:43:29 -07:00
cli.py tools: ynl: add --list-ops and --list-msgs to CLI 2024-05-03 15:13:21 -07:00
ethtool.py tools/net/ynl: ethtool: fix crash when Hardware Clock info is missing 2025-05-22 14:29:39 +02:00
Makefile tools: net: package libynl for use in selftests 2024-07-02 18:59:33 -07:00
Makefile.deps tcp_metrics: add netlink protocol spec in YAML 2024-07-01 09:44:27 +01:00
requirements.txt tools: ynl: add the Python requirements.txt file 2023-03-24 19:11:02 -07:00
ynl-gen-c.py tools: ynl-gen: don't output external constants 2025-05-29 11:03:00 +02:00
ynl-gen-rst.py doc: netlink: Fix op pre and post fields in generated .rst 2024-05-29 18:10:26 -07:00
ynl-regen.sh tools: ynl: don't skip regeneration from make targets 2023-11-29 16:07:00 -08:00