diff options
author | Jakub Kicinski <kuba@kernel.org> | 2024-03-05 21:50:00 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-03-07 22:01:31 +0300 |
commit | 15d2540e0d626b7960c9cafb3c825554fdf1a2b4 (patch) | |
tree | 4ff9aa93504740abefa9964287ba08744bedc840 /tools/net/ynl/lib/ynl.h | |
parent | e3afe5dd3abea43e056a004df02fb49f24cc5ad7 (diff) | |
download | linux-15d2540e0d626b7960c9cafb3c825554fdf1a2b4.tar.xz |
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>
Diffstat (limited to 'tools/net/ynl/lib/ynl.h')
-rw-r--r-- | tools/net/ynl/lib/ynl.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/net/ynl/lib/ynl.h b/tools/net/ynl/lib/ynl.h index dbeeef8ce91a..9842e85a8c57 100644 --- a/tools/net/ynl/lib/ynl.h +++ b/tools/net/ynl/lib/ynl.h @@ -20,6 +20,8 @@ enum ynl_error_code { YNL_ERROR_ATTR_INVALID, YNL_ERROR_UNKNOWN_NTF, YNL_ERROR_INV_RESP, + YNL_ERROR_INPUT_INVALID, + YNL_ERROR_INPUT_TOO_BIG, }; /** |