Conversation
dcasota
force-pushed
the
fix/canister-build-against-current-kernel
branch
6 times, most recently
from
September 7, 2026 12:13
3a0b9a5 to
2590191
Compare
dcasota
force-pushed
the
fix/canister-build-against-current-kernel
branch
4 times, most recently
from
September 11, 2026 19:25
747f97e to
4440647
Compare
dcasota
pushed a commit
to dcasota/photonos-scripts
that referenced
this pull request
Sep 11, 2026
Upstream moved the kernel from 6.12.107 to 6.12.109, which resets Release to 1, so the variant patch now leaves linux at -3 and linux-esx at -2 and the embedded patch takes them to -4 and -3. Regenerated with tools/regen-canister-equivalent.py rather than retargeted by hand - the first use of that script for the job it was written for, one command instead of the archaeology this took the previous four times. Neither 6.12.108 nor 6.12.109 touches crypto/rsa-pkcs1pad.c (checked against kernel.org's incremental patches), so the premise of the canister patch rebase in dcasota/photon#29 is unchanged: the WARN_ON wrapper around !digest_size is still absent and patches 1004 and 1010 still need the rebase to apply at --fuzz=0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dcasota
force-pushed
the
fix/canister-build-against-current-kernel
branch
3 times, most recently
from
September 13, 2026 05:18
632de3c to
2994258
Compare
dcasota
changed the base branch from
5.0
to
fix/kernel-shared-canister-config
September 13, 2026 05:18
dcasota
changed the base branch from
fix/kernel-shared-canister-config
to
5.0
September 13, 2026 05:24
…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 an
x86_64 kernel built without the canister: fips is set by %global inside
%ifarch, so it is 1 on x86_64 unless that line is edited to 0, and
config_x86_64 carries both "is not set" comments. The aarch64 configs
never carried them.
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>
Two defects keep canister_build=1 from producing a usable canister, and a third lets the FIPS build modes run where they cannot work. 1. The patch series no longer applies. Upstream dropped the WARN_ON() wrapper around !digest_size in pkcs1pad_verify(), and that single line is shared context for canister-creation patches 1004 and 1010, so %prep fails at --fuzz=0 with 1 out of 2 hunks FAILED -- crypto/rsa-pkcs1pad.c.rej Rebase both onto the 6.12 series. In 1004 the WARN_ON -> fcw_warn_on conversion is load-bearing rather than cosmetic: WARN_ON emits a __bug_table entry, and keeping __bug_table out of the canister is what that patch exists to do. 2. A canister that does build is rejected at boot: FIPS(fips_integrity_init): processing 8 sections, 687696 bytes Kernel panic - not syncing: FIPS canister verification failed! gen_canister_relocs gives each section an "ondx", the number fips_integrity_init() uses to index its si[] array when reversing a relocation. si[] is built from canister_sections[], which holds only the sections carrying both markers. .bss carries a begin marker only - it is not measured, it is listed so relocations can resolve against it - yet it still consumed an ondx, so every section laid out after .bss was numbered one too high and its relocations were reversed against the wrong section. Let only a measured section consume an index. .bss is NOBITS and cannot hold relocations, so the sentinel is never dereferenced. The measured set, the generated linker script and the canister HMAC are unchanged. 3. acvp_build and kat_build build x86_64 inputs on other architectures. The build system injects both toggles for every architecture. On aarch64, SPECS/linux/linux.spec re-enabled fips after its architecture block and pulled in canister machinery that cannot work there: the canister is arch/x86 crypto and its tooling handles only R_X86_64_* relocations. Independently, in SPECS/linux/linux.spec and SPECS/90/linux/linux.spec alike, acvp_build selects config_x86_64_acvp, the only ACVP config, for an arm64 kernel, and the build fails late for a reason that names neither toggle. Confine the fips override to x86_64, and refuse acvp_build and kat_build on any other architecture with the same block in both specs, so the build stops at once and says why. They are refused rather than undefined because Photon's SpecParser.py cannot undefine an injected macro, and would still compute a .acvp Release that rpm no longer builds. canister_build stays allowed on aarch64, where it is already ignored. Change-Id: Ib5878beeec1dd79e2bcdfefc33639d2b40d69d14 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf
dcasota
force-pushed
the
fix/canister-build-against-current-kernel
branch
from
September 14, 2026 09:28
2994258 to
8419a4e
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.
Problem
Two defects keep
canister_build=1from producing a usable canister, and a third lets the FIPS build modes run where they cannot work.1. The patch series no longer applies.
Upstream dropped the
WARN_ON()wrapper around!digest_sizeinpkcs1pad_verify(). That single line is shared context for canister-creation patches 1004 and 1010, so at--fuzz=0both fail to apply.2. A canister that does build is rejected at boot.
gen_canister_relocsgives each section anondx, the numberfips_integrity_init()uses to index itssi[]array when reversing a relocation.si[]is built fromcanister_sections[], which holds only the sections carrying both markers..bsscarries a begin marker only — it is not measured, it is listed so relocations can resolve against it — yet it still consumed anondx. Every section laid out after.bsswas numbered one too high and its relocations were reversed against the wrong section, so the reconstructed image no longer matched the recorded HMAC. This stayed invisible for as long as the compiler happened to emit.bssafter every measured section.3.
acvp_buildandkat_buildbuild x86_64 inputs on other architectures.The build system injects both toggles for every architecture. On aarch64,
SPECS/linux/linux.specflipsfipsback to 1 after its architecture block and pulls in canister machinery that cannot work there: the canister isarch/x86crypto, and both the generator and the kernel-side interpreter handle onlyR_X86_64_*relocations. Independently, inSPECS/linux/linux.specandSPECS/90/linux/linux.specalike,acvp_buildselectsconfig_x86_64_acvp— the only ACVP config — for an arm64 kernel, and the build fails late for a reason that names neither toggle.Change
Rebase patches 1004 and 1010 onto the current source. In 1004 the
WARN_ON→fcw_warn_onconversion is load-bearing rather than cosmetic:WARN_ONemits a__bug_tableentry, and keeping__bug_tableout of the canister is what that patch exists to do.Let only a measured section consume a section index.
.bssisNOBITSand cannot hold relocations, so the sentinel is never dereferenced. The measured set, the generated linker script and the canister HMAC are unchanged; only the numbering handed to the interpreter changes.Confine the
acvp_buildoverride to x86_64, sofipsstays 0 on aarch64. And refuseacvp_buildandkat_buildon any other architecture, with the same block inSPECS/linux/linux.specandSPECS/90/linux/linux.spec, so the build stops at once and says why. They are refused rather than switched off: Photon'sSpecParser.pycannot undefine a macro the build injected, so it would still compute an.acvpRelease that rpm no longer builds.canister_buildstays allowed on aarch64, where it is already ignored.On x86_64 both specs preprocess identically apart from the new comment, and
SpecParser.pycomputes the same name, sources and patches for every architecture and toggle.Based on #24 / vmware#1673: the canister_config.inc change merges first, this one follows as 6.12.109-3.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JW73JTCUGRcaNTUEQcAMtf