[PATCH 0/2] scripts/config: fix string handling in --set-str and --state
From: Daniel Syauqi
Date: Mon Nov 30 2026 - 02:53:03 EST
Two operations in scripts/config can silently change a string. When
--set-str updates an existing assignment, an ampersand in the new value
expands to the old config line. When --state reads a string such as
"-n", echo consumes it as an option and the query writes no output.
The first patch fixes the escaping on the update path. The second fixes
readback and can be reproduced with a hand-written .config.
Both failures were reproduced on v7.4-rc5 in an arm64 Lima guest. With
the series applied, an out-of-tree arm64 defconfig retained the literal
CMDLINE value "a=1&b=2" and LOCALVERSION "-n" across make olddefconfig.
Chained --state queries returned both values, each on its own line.
I used OpenAI Codex to identify both bugs, draft the fixes and commit
messages, and run the tests in Lima.
Daniel Syauqi (2):
scripts/config: preserve ampersands in string values
scripts/config: print string values literally with --state
scripts/config | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244