diff options
| author | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-22 10:01:41 +0900 |
|---|---|---|
| committer | Masami Hiramatsu (Google) <mhiramat@kernel.org> | 2026-11-22 16:23:27 +0900 |
| commit | 2913c7c94b786a7193faf67390a305895b8180ee (patch) | |
| tree | d66f05f7896c7a00daeb56ec221675ba03bce072 /tools/perf/scripts/python | |
| parent | 8e83fac77aa975cb0b2f2586d5072872a0147db6 (diff) | |
bootconfig: Fix xbc_node_compose_key_after() for value nodes
Fix two issues in xbc_node_compose_key_after() when @node is a value node:
1. Since array values are chained via the child pointer in
xbc_parse_array(), the 2nd and subsequent value nodes of an array have
the preceding value node as their parent rather than the owning key
node. Climbing only one parent (if (xbc_node_is_value(node))) caused
preceding array value strings to be included in the composed key
(e.g. "foo.bar.val1" instead of "foo.bar").
2. Checking `if (!node || node == root)` before climbing to the owning
key node allowed a value node belonging to the subtree @root key node
itself (e.g. `foo = "val"` with `@root = xbc_find_node("foo")`) to
pass the check, climb to @root, skip the key-collection loop
(depth == 0), and return 0 without writing anything (not even a NUL
terminator) to @buf.
Climb parent pointers in a loop while the node is a value node, and
perform the `if (!node || node == root)` check afterward.
Link: https://lore.kernel.org/all/179530930140.109991.1418783350874051238.stgit@devnote2/
Fixes: ca24306d83a1 ("bootconfig: Change array value to use child node")
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
