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: state the 32-bit module bands as the union over splits
kasld_addr_is_module_band() is enforced inside each component, before the
engine has resolved anything, so the static MODULES_START/END must be the
union the arch-header CONTRACT asks for -- not the band this binary's own
default would have. Two arches instantiated it at the compile-time split.
x86_32 stated a literal 0xf0000000. The kernel has no fixed module region:
MODULES_VADDR is VMALLOC_START, which is PAGE_OFFSET plus the runtime lowmem
span plus 8 MiB. That literal is correct only on a 3G split carrying more than
~760 MiB of lowmem; a 512 MiB VM puts the real floor at ~0xe0800000 and every
module address was discarded below it. Booted on the i686 cell at mem=512M the
band now projects to 0xc0800000, under the truth rather than over it.
arm32 had two. The floor was the 3G instance, leaving a VMSPLIT_1G kernel's
modules a full 512 MiB below the band. The ceiling was PAGE_OFFSET, which
describes only the dedicated window: CONFIG_ARM_MODULE_PLTS is default y and
spills overflow into [VMALLOC_START, VMALLOC_END] above PAGE_OFFSET, so the
ordinary configuration -- not an exotic one -- allocated modules the band
rejected. Same shape as the ppc32 platform split.
The rule is now enforced rather than described: the static macros must equal
the relation applied to KERNEL_VIRT_VAS_START, the lowest admissible split on
every arch in scope. An inequality would have passed on the code being fixed
here, since the wrong instantiation is spelled almost exactly like the right
one. ppc32 and riscv32 change spelling only -- their split cannot move, so the
two arguments coincide.
x86_32 is the first arch whose relation ADDS to PAGE_OFFSET, which the wrap
guards read as a wrapped floor and rejected. Both now test the direction the
relation actually moves, folded at compile time. test-cross caught this.
Copy file name to clipboardExpand all lines: docs/kaslr.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -299,15 +299,15 @@ KASLD quantity (`Q_*`) that resolves each region annotated alongside it:
299
299
| Architecture | Text ↔ Phys | Text ↔ Direct map | Text ↔ Modules | Notes |
300
300
|---|---|---|---|---|
301
301
| x86_64 | Independent | Independent | Independent | Three separate randomizations (`CONFIG_RANDOMIZE_MEMORY`) |
302
-
| x86_32 | Coupled | Coupled |Fixed module region | Single KASLR offset |
302
+
| x86_32 | Coupled | Coupled |Tracks lowmem, not text | Single KASLR offset; the module region starts at `VMALLOC_START`, which is `PAGE_OFFSET` plus the runtime lowmem size plus 8 MiB|
303
303
| arm64 | Independent | Independent | Bracketed (within 2 GiB of text) | Separate phys/virt randomization; modules drawn from a window spanning the kernel image, so they move with it |
| PowerPC32 | Coupled | Coupled |Platform-dependent | A dedicated window below `PAGE_OFFSET` on 8xx / book3s32; every other platform, 85xx included, allocates from the shared vmalloc window|
307
307
| PowerPC64 | — | Coupled | Shared VAS | No KASLR |
308
308
| LoongArch64 | Coupled | Coupled | Fixed module region | Direct-mapped windows |
309
309
| RISC-V64 | Virtual only | Decoupled | Coupled (shifts with kernel) | Module region anchored to kernel `_end`; text ↔ directmap coupled on legacy pre-v5.10 kernels (no KASLR) |
310
-
| RISC-V32 | — | Coupled |Same as PAGE_OFFSET | No KASLR |
310
+
| RISC-V32 | — | Coupled |Below PAGE_OFFSET (vmalloc) | No KASLR; modules share the vmalloc window, which on sv32 is the 512 MiB below `PAGE_OFFSET`|
311
311
312
312
On coupled architectures, all sections are at fixed offsets from each other:
313
313
a physical address reveals the virtual text base via
0 commit comments