You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
arch: make every arch declare its image-base residue
image_base_grid_align snaps a resolved _text window to the KASLR grid,
which is sound only where _text's offset within its alignment granule is a
constant. Get that offset wrong and raising a floor lands past the true
base, dropping the truth out of the GUARANTEED window — the one thing that
window promises.
IMAGE_BASE_RESIDUE_FIXED gated it, and defaulted to "the residue is fixed".
Sixteen of seventeen headers took that by silence: a claim about a kernel's
linker layout that nobody had made. Only arm32 had ever answered, and only
because someone hit the case where it is false.
There is no defensible default here, so there is no longer one. The macro
joins the mandatory-macro block beside LINEAR_MAP_ANCHOR and
TEXT_TRACKS_DIRECTMAP, and a header that omits it fails to compile.
The contract now also asks WHICH basis the answer rests on, because two
very different claims were collapsed into one boolean. By construction: the
residue is zero, or the arch models no KASLR, so nothing can drift.
Observed: the residue is non-zero and emerges from something the kernel is
free to change, where agreeing builds are evidence and not a guarantee.
riscv is the second case and is now 0. Its _text is not the load address —
the linker emits _start, then HEAD_TEXT_SECTION, then ALIGN(PAGE_SIZE) —
so the residue is roundup(sizeof .head.text, PAGE_SIZE), and that section
is #ifdef CONFIG_EFI / RISCV_M_MODE / MMU code whose size is not fixed.
Three captures agree at 0x2000 (alpine 6.18, debian 6.12, riscv32 mainline
6.15); that is not the bar this switch asks for.
No output changes, measured rather than assumed: toggling riscv64 between 1
and 0 and diffing full JSON across every riscv64 fixture gives identical
results, because image_base_grid_align emits no constraint on any fixture
in the corpus. The rule's own unit tests are what cover it.
0 commit comments