]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
tools: ynl: check for overflow of constructed messages
authorJakub Kicinski <kuba@kernel.org>
Tue, 5 Mar 2024 18:50:00 +0000 (10:50 -0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Mar 2024 19:01:31 +0000 (11:01 -0800)
commit15d2540e0d626b7960c9cafb3c825554fdf1a2b4
tree4ff9aa93504740abefa9964287ba08744bedc840
parente3afe5dd3abea43e056a004df02fb49f24cc5ad7
tools: ynl: check for overflow of constructed messages

Donald points out that we don't check for overflows.
Stash the length of the message on nlmsg_pid (nlmsg_seq would
do as well). This allows the attribute helpers to remain
self-contained (no extra arguments). Also let the put
helpers continue to return nothing. The error is checked
only in (newly introduced) ynl_msg_end().

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>
Link: https://lore.kernel.org/r/20240305185000.964773-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/net/ynl/lib/ynl-priv.h
tools/net/ynl/lib/ynl.c
tools/net/ynl/lib/ynl.h