[PATCH 0/2] bootconfig: Fix maximum-depth key export
From: Zhiqi Zhang
Date: Wed Nov 04 2026 - 02:47:47 EST
I found that bootconfig accepts a key with the supported maximum of 16
components but fails to reconstruct its full name. This stops the tool's
list output and prevents the kernel from creating /proc/bootconfig.
Patch 1 moves the capacity check before collecting the next component.
Patch 2 adds a full-output comparison to the existing bootconfig suite,
including a check that 17-component keys are still rejected.
Validation on mainline 05441d697f7f:
- GCC 14.2 and Clang 19.1, -Wall -Werror: 82 tool checks pass each.
- The added test fails before the fix and passes after it. The independent
nine-case boundary/round-trip matrix changes from 5 pass/4 fail to 9 pass.
- GCC ASan/UBSan: the reproducer and all nine matrix cases pass.
- Real arm64 kernels under QEMU TCG: depth 15 passes before and after;
depth 16 loses /proc/bootconfig before, and exports the exact key/value
after. Both kernels use identical configurations and initramfs inputs.
- A full baseline W=1 build succeeds with existing warnings in arm64
sys.c/traps.c and sched/rt.c; bootconfig has none. The fixed incremental
kernel build recompiles lib/bootconfig.o and relinks without warnings.
This is a long-standing functional bug, present in the feature's original
commit. Mainline, linux-next and the bootconfig for-next tree retain it;
no matching posted fix was found in the checked public patch records.
I used OpenAI Codex to verify the issue and develop the fix. I reviewed
the changes and wrote and ran the regression tests. Codex also helped
with additional checks of the boundary cases.
Testing is limited to little-endian arm64 with external initramfs
bootconfig; other architectures, embedded/forced bootconfig, allmodconfig
and fault injection have not been verified.
Zhiqi Zhang (2):
bootconfig: Allow keys with the maximum supported depth
tools/bootconfig: Test listing keys at the maximum depth
lib/bootconfig.c | 2 +-
tools/bootconfig/test-bootconfig.sh | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
base-commit: 05441d697f7f9a927264f4058cbbc6a03dfcac9d
--
2.54.0 (Apple Git-157)