# Re: \[RFC PATCH 1/5\] bootconfig: Add multi-config ID helpers and xbc\_init\_configs() support

- From: Masami Hiramatsu (Google) \<mhiramat@kernel.org\>
- Date: 2026-11-29 00:47:59 
- List: linux-trace-kernel
- Page: https://ratatoskr.run/linux-trace-kernel/2026/11/18044077
- Thread: https://ratatoskr.run/linux-trace-kernel/2026/11/18039429/t.md

```text
On Fri, 27 Nov 2026 15:02:18 +0000, sashiko-bot@kernel.org [ref] wrote:

> [Severity: Medium]
> Can an unclosed brace in a later config be misattributed to an earlier
> config in xbc_init_configs()?
> 
> When a subsequent config reopens a key that was already defined in an
> earlier config (for example, top-level "kernel {") and omits the closing
> brace, __xbc_add_key() reuses the existing struct xbc_node from the
> earlier config without updating node->data:
> 
> lib/bootconfig.c:__xbc_add_key() {
> 	...
> 	node = find_match_node(node, data);
> 	if (node) {
> 		last_parent = node;
> 	} else {
> 	...
> }
> 
> Because xbc_node_get_data(n) still points into the earlier config's slice
> of xbc_data, xbc_parse_error() sets xbc_err_pos to an offset within that
> earlier slice.  The error-mapping loop in xbc_init_configs() then reports
> the earlier config's index in *err_idx and its offset in *epos instead of
> blaming the config that left the brace unclosed.

Oops, good catch! Yes, that should be a problem. Let's check the unclosed
brace position and config boundary (offset).

Thank you,

-- 
Masami Hiramatsu (Google) [ref]
```
