Repository navigation
Conversation
Hou Wenlong's RFC (0014-0018, 2026-01-26, unchanged on 7.3.5) lets a vmlinux entered through PVH randomize its own virtual base at startup_64, from a relocation table the relocs tool writes into .data.reloc. 0019 sets KASLR_FLAG when it did, so RANDOMIZE_MEMORY moves the direct map, vmalloc and vmemmap. 0020 reads RDRAND and TSC from the CPUID registers that hold them: the RFC reads them swapped, and drew the virtual base from the i8254 and boot_params alone. The build asserts each patch on the vmlinux, prints how much of the table the kernel uses, and refuses instrumentation or GOT references in the code that runs before the relocation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0008 honours XEN_ELFNOTE_PHYS32_RELOC, which Linux emits under CONFIG_PVH: the physical base a bzImage's decompressor chose before, drawn from qemu_guest_getrandom. pvh.bin ships again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…self (#645) A release whose vmlinux has both Xen notes boots it with pvh.bin; one without (v20261119.02 to v20261123.06) boots its bzImage as before. verify kernel asserts the notes and a filled .data.reloc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run on every change that reaches the machine (compat.yml). The regions are read through real addresses, kptr_restrict at 1: at 0 %pK prints a hash that differs every boot whatever the layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#645) checkpatch's MAINTAINERS question for an added file is left out by name: no patch here goes upstream until it has run in production. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he decompressor (#645) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aledbf
force-pushed
the
kernel/645-kaslr-pvh
branch
from
November 23, 2026 17:46
139474a to
9915ffc
Compare
Member
Author
|
Replaced by #675: the same commits on a linear branch off main (this one carries a merge commit, and the repository merges by rebase with linear history), plus the fixes for the red Gate (mutate), Compat (sparse over misc.c) and CodeQL (the kernel's bzImage-only files). |
This was referenced Nov 23, 2026
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.
Why
The goal is a cold boot to the first SSH login in under 100 ms (v20261123.06: 370 cold, 72.2 restored). A bzImage's decompressor spent ~21 ms (bench) on a copy, LZ4 and parse_elf before the kernel's clock, and it was the only thing that randomized the kernel. This boots the release's vmlinux through PVH instead, the kernel moving itself to a random base (#645).
What
Kernel 0014-0018: Hou Wenlong's RFC (2026-01-26), made checkpatch --strict clean with each change noted in its header. 0019 sets
KASLR_FLAGonce the kernel moved, soRANDOMIZE_MEMORYruns. 0020 reads RDRAND and TSC from the CPUID registers that hold them: the RFC reads them swapped, so its virtual base was drawn from the i8254 andboot_paramsalone. Config:PVH,RELOCATABLE_UNCOMPRESSED_KERNEL, a 1 MiB table.QEMU 0008: a random physical base from
XEN_ELFNOTE_PHYS32_RELOC.pvh.binships again.machine: a release whose vmlinux carries both Xen notes boots it through PVH; one without (v20261119.02 to v20261123.06) boots its bzImage as before. The bzImage still ships (spin's
hack/machine/place.goasks for it, After #645, the bzImage, KERNEL_LZ4 and QEMU 0007 serve only releases before it #660).Checks:
verify kernelasserts both notes and a filled.data.reloc(fixture:internal/elftest). The kernel build asserts each patch, prints the table's use, and refuses__fentry__, sanitizer, stack-protector or GOT references in the pre-relocation object.boot:kaslr(compat.yml) requires_text, the physical base, the direct map and vmalloc each to move across 10 boots, through real addresses.The kernel build's gates (Carried patches: no static analysis, no fuzzing, and the patched packages' own tests are off #653, kernel: enforce checkpatch --strict and sparse on the patched files (#653) #656), changed for these patches: checkpatch leaves out
FILE_PATH_CHANGES(the MAINTAINERS question for an added file) by name; sparse runs over a file a patch adds with every warning counted new, over the decompressor'smisc.cwith the sparse command the bzImage's build ran for it (a single-object target compiles it with vmlinux's flags and failed, job 137873298240), and not overarch/x86/tools, host programsC=never checks.Measured
Bench, spin's shape and login, against v20261123.06, 60 a side, measured on the kernel before 0020. 0020 adds one RDRAND and one RDTSC to the boot and goes in as a security fix, not as a boot change:
State −31.9 MiB, QEMU's RSS −13.8 MiB. The bound (no KASLR) was −18.9 cold, −3.6 restored (labs 45213668842, 45213683698).
The three questions
The machine's record
compat.yml on this PR (
boot:record,boot:compat) says whether the record moves, and this section is filled in from its run before merge.🤖 Generated with Claude Code