diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-22 10:01:32 +0900 |
|---|---|---|
| committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-22 16:23:17 +0900 |
| commit | 8e83fac77aa975cb0b2f2586d5072872a0147db6 (patch) | |
| tree | a5b32243256c87d2284ee02cfe4e22e80895ecec /tools/perf/scripts/python | |
| parent | 9ae84f30d74763bcee0dd8c2155c7dfeb135f5fa (diff) | |
bootconfig: Fix xbc_verify_tree() to check subkeys of valued keys
When a key node has both a value and subkeys, the value node is always
inserted as the first child of the key node (xbc_add_head_sibling()), and
subkeys follow as next siblings of that value node.
However, xbc_verify_tree() uses xbc_node_get_child(n) and checks
xbc_node_is_key(m) to descend into subkeys. When a key node has a value,
xbc_node_get_child(n) returns the value node, so xbc_node_is_key(m) is
false and xbc_verify_tree() completely skips verifying all subkeys under
that key. This allows subkeys under a valued key to bypass both the
XBC_DEPTH_MAX (16) and XBC_KEYLEN_MAX (256) checks during xbc_init(),
causing runtime -ERANGE failures in xbc_node_compose_key_after().
Use xbc_node_get_subkey(n) so that subkeys of mixed value+subkey nodes
are properly verified.
Link: https://lore.kernel.org/all/179530929234.109991.150550090881188440.stgit@devnote2/
Fixes: e5efaeb8a8f5 ("bootconfig: Support mixing a value and subkeys under a key")
Cc: stable@vger.kernel.org
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
