linux, linux-esx: share the canister/.config logic via canister_config.inc - #1673
Open
dcasota wants to merge 1 commit into
Open
linux, linux-esx: share the canister/.config logic via canister_config.inc#1673dcasota wants to merge 1 commit into
dcasota wants to merge 1 commit into
Conversation
dcasota
force-pushed
the
fix/kernel-shared-canister-config
branch
2 times, most recently
from
September 3, 2026 13:11
e19c8f6 to
2ca007a
Compare
…g.inc
linux.spec and linux-esx.spec implemented the same canister Kconfig handling
in two different idioms, and they disagreed on one constellation.
linux-esx.spec used %if 0%{?fips} / %else, and its %else branch cleaned the
GCC_PLUGIN_{MATCH,PAD}_CANISTER_STRUCTS comments out of .config. linux.spec
instead used two independent %if canister_build / %if canister_usage blocks
with no %else, so when fips=0 nothing ran: the shipped .config kept the
"is not set" comments, make olddefconfig dropped them, and the
check_for_config_applicability.inc diff guard failed %prep. That is the
generic aarch64 kernel - fips is set by %global inside %ifarch, so it is
unconditionally 1 on x86_64 and cannot be overridden with -D, and
acvp_build/kat_build force fips=1 even on aarch64.
Move the three conditional blocks into SPECS/linux/canister_config.inc,
pulled in by both specs as Source5 + %include, the same mechanism both
already use for check_for_config_applicability.inc. Divergence between the
two flavours is now impossible by construction.
linux-esx.spec additionally gains the derived-flag block linux.spec already
had (canister_build=0, canister_usage=fips), nested inside the existing
%if fips so it does not shadow -D. esx never builds a canister - it untars a
prebuilt one - so fips=1 implies canister_usage=1, reproducing the old
branch exactly.
Tested across 112 cells: 2 specs x {x86_64, aarch64} x subrelease {91, 92} x
14 flag combinations of fips / canister_build / canister_usage / acvp_build /
kat_build. All x86_64 cells are byte-identical apart from the release string.
The aarch64 fips=0 cells replace PR#14's broad sed with linux-esx's narrower
pair; the two forms produce byte-identical output on all five shipped config
files, because no config contains a CANISTER_STRUCTS=y form - only the
"is not set" comment form. The esx aarch64 reordering is likewise a no-op:
the canister and jitterentropy seds touch disjoint symbols.
Change-Id: If4107c14d8f15752dff0c0f25c6b4dee504e3041
Signed-off-by: Daniel Casota <dcasota@gmail.com>
dcasota
force-pushed
the
fix/kernel-shared-canister-config
branch
from
September 3, 2026 16:36
2ca007a to
7ba215f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
linux.specandlinux-esx.specimplemented the same canister Kconfig handling in two different idioms, and they disagreed on exactly one constellation.Which constellation breaks, and why only that one
The generic aarch64 kernel —
linux,fips=0. 16 of the 56linuxcells.linux-esx.specused%if 0%{?fips}/%else, and its%elsebranch cleaned theGCC_PLUGIN_{MATCH,PAD}_CANISTER_STRUCTScomments out of.configunder the comment "Clean up .config of FIPS related configs".linux.specinstead used two independent%if 0%{?canister_build}/%if 0%{?canister_usage}blocks with no%else— so whenfips=0neither fired, the shipped.configkept theis not setcomments,make olddefconfigdropped them, and thecheck_for_config_applicability.incdiff guard failed%prep.Why no other cell is affected:
fipsis%global-set to 1 inside%ifarchand cannot be overridden with-D, sofips=0is unreachableacvp_build=1orkat_build=1fips=1, so even on aarch64 they land in the canister branchesfips=1+canister_build=1canister_buildblock fires — identical seds, identical orderfips=1+canister_usage=1(production x86_64, both flavours)canister_usageblock fires; that sed text was already character-identical in the two specs-D canister_build 1%if fipsblock, so the branch stays unreachable for esxThe change
Three conditional blocks move into
SPECS/linux/canister_config.inc, pulled in by both specs asSource5+%include— the same mechanism both already use forcheck_for_config_applicability.inc. Divergence between the flavours is now impossible by construction rather than caught later. Rationale lives in%dnllines so it doesn't leak into the expanded%prep.linux-esx.specadditionally gains the derived-flag blocklinux.specalready had (canister_build=0,canister_usage=fips), nested inside the existing%if fipsso it doesn't shadow-D. esx never builds a canister — it untars a prebuilt one — sofips=1⇒canister_usage=1, reproducing the old branch exactly.Testing — 112 cells
2 specs × {x86_64, aarch64} × subrelease {91, 92} × 14 flag combinations of
fips/canister_build/canister_usage/acvp_build/kat_build. aarch64 reached withrpmspec --target aarch64; no spec was edited to simulate it.linux-esx, all 28 x86_64 cells%prepbyte-identical (only the release string moves)linux-esx, all 28 aarch64 cellslinux, all 28 x86_64 cellslinux, 12 aarch64 cells where acvp/kat forcefips=1linux, 16 aarch64fips=0cellsWhole-spec diff (not just
%prep) across all 112 cells shows nothing moved in%build,%install,%filesor package metadata.The two deltas are proven no-ops, not argued
Broad sed vs narrow pair, executed against every shipped config:
Root cause: no config contains a
CANISTER_STRUCTS=yform — only the# … is not setcomment form. So the narrow pair matches everything the broad form would. Neither aarch64 config mentions the symbols at all, which is why the one cell that changed is also the one where both forms do nothing.Reordering on esx aarch64: the canister seds and the jitterentropy seds touch disjoint symbols (
CONFIG_GCC_PLUGIN_*_CANISTER_STRUCTSvsCONFIG_CRYPTO_JITTERENTROPY_*) andsed -iis line-local, so order cannot matter. The include is placed after the%if fipsblock deliberately, so thefips=1ordering (tar -xvf fips-canister…→touch→ canister sed) is untouched.support/spec-checker/check_spec.pyexits 0 on both specs.Supersedes the standalone fix in #14 — same behaviour, now in the shared include.