For an attribute whose nla_len is smaller than the attribute header, nla_len - MNL_ATTR_HDRLEN wraps and is truncated to 65532..65535. mnl_attr_for_each_nested() (and so mnl_attr_parse_nested()) uses it as the nest length, so mnl_attr_ok() is told there is room for attributes and reads a header past the end of the nest. Return 0 in that case, so the nest iterates no attributes. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Florian Stosse --- src/attr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/attr.c b/src/attr.c index 0254190..69d23af 100644 --- a/src/attr.c +++ b/src/attr.c @@ -63,6 +63,9 @@ EXPORT_SYMBOL uint16_t mnl_attr_get_len(const struct nlattr *attr) */ EXPORT_SYMBOL uint16_t mnl_attr_get_payload_len(const struct nlattr *attr) { + if (attr->nla_len < MNL_ATTR_HDRLEN) + return 0; + return attr->nla_len - MNL_ATTR_HDRLEN; } -- 2.56.0.windows.4