linux/tools/net/ynl/lib
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
..
.gitignore selftests: add ncdevmem, netcat for devmem TCP 2024-09-11 20:44:32 -07:00
__init__.py tools/net/ynl: Report netlink errors without stacktrace 2024-03-07 20:28:26 -08:00
Makefile tools: net: package libynl for use in selftests 2024-07-02 18:59:33 -07:00
nlspec.py tools: ynl: add --list-ops and --list-msgs to CLI 2024-05-03 15:13:21 -07:00
ynl-priv.h tools: ynl: make user space policies const 2024-06-09 15:51:40 +01:00
ynl.c tools: ynl-gen: validate 0 len strings from kernel 2025-05-29 11:03:12 +02:00
ynl.h tools: ynl: make user space policies const 2024-06-09 15:51:40 +01:00
ynl.py tools/net/ynl: fix sub-message key lookup for nested attributes 2024-12-27 14:02:02 +01:00