Skip to content

Commit 7af6c14

Browse files
committed
docs: Standardize American spelling and KASLD casing, refreshed samples
Standardize spelling to American (-ize) across the tool's output, comments, and docs: the banner now reads "Kernel ASLR derandomization", matching the body ("not derandomized"); the kernel only ever emits the American spelling, so parsers are unaffected. Standardize the project name as KASLD, with `kasld` reserved for the command. Rewrite the usage.md intro to lead with purpose (recover a running kernel's layout via components feeding an inference engine) instead of internal component mechanics. Regenerate every README/usage output sample from a vanilla kernel.org x86_64 6.15.6 boot under kernel-default settings — added a `x86_64-vanilla` build-kernel spec and a `stock` VM profile (unprivileged, no sysctls weakened or hardened) to make those samples reproducible.
1 parent 3ec1f9d commit 7af6c14

43 files changed

Lines changed: 313 additions & 327 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ single-source covering** of the region (a whole RAM map: every E820 / device-tre
144144
extents, so it makes no positional claim: floor rules ignore it (they require
145145
`pos=base`), and the orchestrator routes it out of the cross-source merge into
146146
the engine's `coverings[]` so the map stays faithful and per-source. Only emit it
147-
from a source that reads the **whole** map — a partial map would synthesise false
147+
from a source that reads the **whole** map — a partial map would synthesize false
148148
gaps, which `tests/check-extent-callers` guards against.
149149

150150
All helpers return `1` on emit, `0` on rejection (with a stderr
@@ -159,7 +159,7 @@ when you know exactly what's at the address — a kernel symbol
159159
(`nf_conntrack`), a device (`0000:00:14.0`).
160160

161161
A component that detects KASLR being switched off (or unsupported, or having
162-
failed to randomise) emits scalar facts via `kasld_emit_scalar()` instead of an
162+
failed to randomize) emits scalar facts via `kasld_emit_scalar()` instead of an
163163
address; which facts, and how the engine consumes each, are documented in
164164
[docs/architecture.md → KASLR runtime states](docs/architecture.md#kaslr-runtime-states).
165165

@@ -294,7 +294,7 @@ kasld_result_range(KASLD_TYPE_VIRT, REGION_INITRD,
294294
295295
The `#ifdef` guard compiles the derivation out on arches where the
296296
direct-map projection is unsound at compile time — x86_64 with
297-
`CONFIG_RANDOMIZE_MEMORY` (direct-map base randomised), arm64 / riscv64
297+
`CONFIG_RANDOMIZE_MEMORY` (direct-map base randomized), arm64 / riscv64
298298
/ s390 (text and direct map at independent runtime offsets). On those
299299
arches the macro is undefined, so forgetting the guard fails to compile
300300
rather than silently emitting a wrong observation. See
@@ -441,7 +441,7 @@ directly via the constants in `kasld/api.h`'s include chain):
441441
| `KERNEL_VIRT_TEXT_DEFAULT` | Default (non-randomized) kernel text base |
442442
| `KERNEL_VIRT_VAS_START`, `KERNEL_VIRT_VAS_END` | Kernel virtual address space bounds |
443443
| `KERNEL_VIRT_TEXT_MIN`, `KERNEL_VIRT_TEXT_MAX` | Plausible kernel text range (validation) |
444-
| `KASLR_VIRT_TEXT_MIN`, `KASLR_VIRT_TEXT_MAX` | KASLR randomisation window (slot counting) |
444+
| `KASLR_VIRT_TEXT_MIN`, `KASLR_VIRT_TEXT_MAX` | KASLR randomization window (slot counting) |
445445
| `KASLR_VIRT_TEXT_MIN_WIDE` | Conservative widened floor (admits non-default Kconfigs) |
446446
| `PAGE_OFFSET` | Direct-map base (compile-time default) |
447447
| `PHYS_OFFSET` | Physical RAM base address |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ CC = cc
1414
CFLAGS = -g -O2 -Wall -Wextra -pedantic
1515

1616
# Diagnostics layer. Each flag is probed against $(CC) at make-time via
17-
# cc-option; flags the compiler doesn't recognise simply drop out instead
17+
# cc-option; flags the compiler doesn't recognize simply drop out instead
1818
# of generating per-file noise. This keeps the build portable across:
1919
# - older gcc (pre-6 lacks -Wnull-dereference, -Wduplicated-cond,
2020
# -Wrestrict; pre-7 lacks -Wduplicated-branches, -Walloca; pre-4.9

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"/>
99
</p>
1010

11-
KASLD derandomises the Linux kernel's virtual and physical memory layout
11+
KASLD derandomizes the Linux kernel's virtual and physical memory layout
1212
as an unprivileged local user. It recovers the kernel text base where a
1313
leak or side channel allows, and otherwise reduces it to the smallest set
1414
of placements the available evidence supports. On a fully-patched modern
@@ -61,22 +61,22 @@ can temporarily relax these settings (requires root).
6161
The default text mode prints an answer-first overview:
6262

6363
```
64-
KASLD 0.2.0 -- Kernel ASLR derandomisation
65-
Target: x86_64 / 6.12.38+deb13-amd64
64+
KASLD 0.2.1-dev -- Kernel ASLR derandomization
65+
Target: x86_64 / 6.15.6
6666
6767
Running 83 components (10 experimental skipped; use -x to enable)...
68-
[####################] 100% 83/83 10.5s
68+
[####################] 100% 83/83 5.3s
6969
70-
Virtual text base 0xffffffffa7a00000 slide +0x26a00000
71-
Physical text base not derandomized ~9 bits
72-
0x0000000001000000 - 0x000000002eedbce0 (367 x 2.0 MiB)
70+
Virtual image base 0xffffffff83800000 slide +0x2800000
71+
Physical image base not derandomized ~9 bits
72+
0x0000000001000000 - 0x000000003c20ca00 (473 x 2.0 MiB)
7373
Direct map base >= 0xffff800000000000
7474
7575
Coupling virt and phys text are independent on this arch.
7676
A phys leak does NOT reveal the virt text base.
7777
7878
Leaks (1):
79-
virt kernel text 0xffffffffa7a00000 (prefetch)
79+
virt kernel text 0xffffffff83800000 (prefetch)
8080
8181
[-v: detailed results, memory map, system info] [-H: hardening assessment]
8282
```

docs/architecture.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Components communicate results to the orchestrator via tagged lines on stdout:
198198
| `pos` | `base` / `top` / `interior` / `extent` / `unknown` | What the address keys represent within the region. `base` requires `lo`, `top` requires `hi`, `interior` requires `sample`, `extent` requires both `lo` and `hi`. `unknown` requires at least one of the address keys. |
199199
| `conf` | `parsed` / `derived` / `inferred` / `heuristic` / `timing` / `brute` | How reliable the source is. Strict trust ordering — see [Confidence](../CONTRIBUTING.md#confidence). |
200200
| `lo` / `hi` | `0x`-prefixed hex | Inclusive extent bounds. Either may be absent. |
201-
| `sz` | `0x`-prefixed hex | Mutually exclusive with `hi`. Parser normalises to `hi = lo + sz - 1`. Rejected on overflow or `sz == 0`. |
201+
| `sz` | `0x`-prefixed hex | Mutually exclusive with `hi`. Parser normalizes to `hi = lo + sz - 1`. Rejected on overflow or `sz == 0`. |
202202
| `sample` | `0x`-prefixed hex | A representative interior point. |
203203
| `base_align` | `0x`-prefixed hex, power of two | Declared alignment of the extent base. Optional. |
204204

@@ -240,7 +240,7 @@ cannot start there). A covering is therefore:
240240

241241
- **Not corroboratable, never merged.** Two sources' maps must not be mixed: a
242242
runtime-offlined block is RAM in the boot E820 but a hole in a hotplug view, so
243-
unioning would melt a real gap or synthesise a false one. Each map is
243+
unioning would melt a real gap or synthesize a false one. Each map is
244244
independently complete for its own substrate.
245245
- **Routed out-of-band.** The orchestrator sends `pos=extent` records to a
246246
dedicated `coverings[]` store on the evidence set, **bypassing the merge**, and
@@ -268,7 +268,7 @@ derived records during the fixpoint loop after collecting all leaked results.
268268
Components that leak a physical address can convert it to a direct-map virtual
269269
address using `phys_to_directmap_virt(p)`, guarded by
270270
`#ifdef phys_to_directmap_virt` so the derivation is compiled out on arches where
271-
the projection is unsound (x86_64 `CONFIG_RANDOMIZE_MEMORY` randomises the
271+
the projection is unsound (x86_64 `CONFIG_RANDOMIZE_MEMORY` randomizes the
272272
direct-map base; arm64 / riscv64 / s390 keep text and direct map at independent
273273
runtime offsets). The component emits two records — one `PHYS`, one `VIRT` — both
274274
with the same `(region, name)`. The merge pass keeps them as separate records
@@ -308,12 +308,12 @@ Key rules for cross-region derivation:
308308
how a runtime vmsplit propagates on coupled architectures.
309309
- **`directmap_kaslr_disabled_pin`** (x86_64) — when `CONFIG_KASAN=y`
310310
(`SF_KASAN_ENABLED`) or KASLR is off (`SF_VIRT_KASLR_DISABLED`) the direct-map
311-
randomisation is suppressed (`kaslr_memory_enabled() = kaslr_enabled() &&
311+
randomization is suppressed (`kaslr_memory_enabled() = kaslr_enabled() &&
312312
!CONFIG_KASAN`), so `Q_PAGE_OFFSET` / `Q_VMALLOC_BASE` / `Q_VMEMMAP_BASE` are
313313
pinned to their compile-time L4/L5 defaults — the paging level from
314314
`SF_VIRT_ADDR_BITS` (cpuinfo, leak-free) or, when that is unavailable, a
315315
resolved `Q_VA_BITS` (e.g. from a direct-map leak). Kernel TEXT KASLR is
316-
independent and stays randomised.
316+
independent and stays randomized.
317317

318318
### Coupled vs decoupled architectures
319319

@@ -329,7 +329,7 @@ compile-time `PAGE_OFFSET`, `PHYS_OFFSET`, and `TEXT_OFFSET` constants (with
329329
default).
330330

331331
On **decoupled** architectures (x86_64, arm64, riscv64, s390), physical and
332-
virtual KASLR are randomised independently, so physical results cannot derive
332+
virtual KASLR are randomized independently, so physical results cannot derive
333333
virtual text directly. The summary prints a note when physical results exist that
334334
would have been derivable on a coupled system.
335335

@@ -348,8 +348,8 @@ they have different implications for the inference engine:
348348
| State | Scalar fact(s) | Kernel position | Engine action |
349349
|---|---|---|---|
350350
| **Disabled** (user/build opt-out) | `SF_VIRT_KASLR_DISABLED` + `SF_PHYS_KASLR_DISABLED` | Compile-time default on each axis | `virt_kaslr_disabled_pin` pins `Q_VIRT_IMAGE_BASE` on arches that set `KASLR_DISABLED_PINS_VIRT_TEXT`; `phys_kaslr_disabled_pin` pins `Q_PHYS_IMAGE_BASE` on arches that set `KASLR_DISABLED_PINS_PHYS`; on x86_64 `directmap_kaslr_disabled_pin` also pins the direct-map bases |
351-
| **Direct map unrandomised** (x86_64 `CONFIG_KASAN`) | `SF_KASAN_ENABLED` | TEXT still randomised; `page_offset` / `vmalloc` / `vmemmap` at their L4/L5 defaults | `directmap_kaslr_disabled_pin` pins the three direct-map quantities — `kaslr_memory_enabled() = kaslr_enabled() && !CONFIG_KASAN`, so KASAN suppresses `RANDOMIZE_MEMORY` even when it is configured |
352-
| **Unsupported** (arch never had KASLR) | both `SF_*_KASLR_DISABLED` synthesised with origin `arch-no-kaslr` | Bootloader-determined | Inert for inference (these arches set neither pin flag); lights the renderer's "KASLR not supported" banner |
351+
| **Direct map unrandomized** (x86_64 `CONFIG_KASAN`) | `SF_KASAN_ENABLED` | TEXT still randomized; `page_offset` / `vmalloc` / `vmemmap` at their L4/L5 defaults | `directmap_kaslr_disabled_pin` pins the three direct-map quantities — `kaslr_memory_enabled() = kaslr_enabled() && !CONFIG_KASAN`, so KASAN suppresses `RANDOMIZE_MEMORY` even when it is configured |
352+
| **Unsupported** (arch never had KASLR) | both `SF_*_KASLR_DISABLED` synthesized with origin `arch-no-kaslr` | Bootloader-determined | Inert for inference (these arches set neither pin flag); lights the renderer's "KASLR not supported" banner |
353353
| **Randomization failed** (boot stub tried, no entropy) | `SF_VIRT_KASLR_RANDOMIZATION_FAILED` + `SF_PHYS_KASLR_RANDOMIZATION_FAILED` | Firmware-/boot-stub-deterministic, NOT the link-time default | Does not pin. Drives the hardening-report entropy downgrade, `efi_loader_kernel_pick` lowest-survivor disambiguation, and the `s390_text_no_random` upper bound |
354354

355355
**Disabled.** KASLD treats the virtual and physical disable signals as
@@ -367,7 +367,7 @@ riscv64, loongarch64, s390), gated by a window-containment soundness check;
367367
that set `KASLR_DISABLED_PINS_PHYS` (currently x86_64 and loongarch64).
368368

369369
**Unsupported.** "KASLR not supported" (compile-time `KASLR_SUPPORTED=0` — arm32,
370-
ppc64, riscv32, sparc) is synthesised by the orchestrator as both facts with
370+
ppc64, riscv32, sparc) is synthesized by the orchestrator as both facts with
371371
origin `arch-no-kaslr`, inert for inference, but lights the renderer's "KASLR not
372372
supported" banner.
373373

docs/bypass-techniques.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ On architectures with tight entropy budgets — x86_64 and x86_32 (~500 slots,
394394
effective slot count by 3–8%. On arm64 (~33M slots) and s390 (~131K slots) the
395395
reduction is negligible.
396396

397-
Weaknesses in randomisation can decrease entropy, further limiting the possible kernel
397+
Weaknesses in randomization can decrease entropy, further limiting the possible kernel
398398
locations in memory and making the kernel easier to locate.
399399

400400
### Randomization failure at boot

docs/diagrams/address-space-map.svg

Lines changed: 8 additions & 8 deletions
Loading

docs/diagrams/arch-coupling-quadrant.svg

Lines changed: 5 additions & 5 deletions
Loading

docs/diagrams/wire-line-anatomy.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/exploitation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ ffffffff82276cb0 T commit_creds
9898
### Inverse — known symbol → base
9999

100100
Given any one known runtime symbol address (e.g. via a UAF read,
101-
infoleak, or side channel that returned a recognisable pointer),
101+
infoleak, or side channel that returned a recognizable pointer),
102102
derive the runtime text base. Useful when the leak points at a
103103
specific symbol rather than at `_text` itself.
104104

0 commit comments

Comments
 (0)