Re: [PATCH v2 0/3] bootconfig: Preserve values and key paths during parsing and output
From: Masami Hiramatsu (Google)
Date: Fri Nov 13 2026 - 00:45:37 EST
On Tue, 10 Nov 2026 20:08:44 +0100, Eduardo Mucelli Rezende Oliveira <edumucelli@xxxxxxxxx> wrote:
> Hi Masami,
>
> Thanks again for reviewing the earlier fixes. This v2 addresses the
> issue Sashiko reported in the first patch.
>
> The parent array in v1 assumed that the parser always enforced
> XBC_DEPTH_MAX. I reproduced the reported overflow with AddressSanitizer
> using a 20-component chain where each parent also has a value. The
> existing verifier skips the subkeys in that case, so the parser accepts
> a deeper tree than the formatter's array can hold.
>
> Patch 1 now checks the key children to determine whether a node opened
> braces, using the same conditions as the forward walk. It no longer
> keeps a depth-indexed array. The existing verifier gap is a separate
> issue; this revision removes the formatter's dependency on that check.
>
> Changes in v2:
> - Patch 1: derive brace ownership from the key children.
> - Patches 2 and 3: unchanged.
>
> I tested this on my Ubuntu machine. All 137 focused checks pass for the
> combined series, and the full bootconfig suite passes after each patch
> (86 passed, zero failed for the complete series). I also checked the
> revised first patch and the combined series with AddressSanitizer and
> UBSan using value-bearing chains up to 95 components.
>
> Review: https://lore.kernel.org/all/sashiko-outbox-207566@xxxxxxxxxx/
> V1: https://lore.kernel.org/all/cover.1794333957.git.edumucelli@xxxxxxxxx/
These looks good to me too.
BTW, what checker did you use?
Thanks,
>
> Feedback is welcome.
>
> Thanks,
> Eduardo
>
> Eduardo Mucelli Rezende Oliveira (3):
> tools/bootconfig: Close only opened braces in compact output
> bootconfig: Trim unquoted values at end of file
> tools/bootconfig: Preserve values containing both types of quotes
>
> lib/bootconfig.c | 5 ++-
> tools/bootconfig/main.c | 43 +++++++++++++------
> .../samples/exp-good-mixed-kv1.bconf | 5 +++
> tools/bootconfig/samples/good-mixed-kv1.bconf | 5 +++
> tools/bootconfig/test-bootconfig.sh | 29 +++++++++++++
> 5 files changed, 72 insertions(+), 15 deletions(-)
>
>
> base-commit: 677f83795fdfc25ddc51b665a9111f5ff199f7ca
> --
> 2.53.0
>
>
--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>