summaryrefslogtreecommitdiff
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-01-23 17:21:30 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 10:02:12 +0100
commit7ed5254078c3120c66221effa3b662e988e6ca8c (patch)
treefa0ca24866ab564c067378c17ff35b331e9ee7ed /tools/perf/util/annotate.c
parenta275db45b4161d01716559dd7557db9ea0450952 (diff)
tools: ynl: c: correct reverse decode of empty attrs
[ Upstream commit 964417a5d4a06614ef7fb3ae69bb17c91a2dc016 ] netlink reports which attribute was incorrect by sending back an attribute offset. Offset points to the address of struct nlattr, but to interpret the type we also need the nesting path. Attribute IDs have different meaning in different nests of the same message. Correct the condition for "is the offset within current attribute". ynl_attr_data_len() does not include the attribute header, so the end offset was off by 4 bytes. This means that we'd always skip over flags and empty nests. The devmem tests, for example, issues an invalid request with empty queue nests, resulting in the following error: YNL failed: Kernel error: missing attribute: .queues.ifindex The message is incorrect, "queues" nest does not have an "ifindex" attribute defined. With this fix we decend correctly into the nest: YNL failed: Kernel error: missing attribute: .queues.id Fixes: 86878f14d71a ("tools: ynl: user space helpers") Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250124012130.1121227-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/perf/util/annotate.c')
0 files changed, 0 insertions, 0 deletions