In short, LASS enforces all kernel memory accesses to have bit 63 set to 1, and all userspace accesses have bit 63 set to 0. Violations of these rules cause #GP. There are natural exceptions, like SMAP with rflags.AC=1 allows kernel to access userspace. Enablement is simple, we need to set CR4.LASS bit on all CPUs. There are complications when kernel has to execute code at low addresses, e.g. for la57 trampoline, or calling into EFI RT. The patch turns CR4.LASS off around these regions. LASS is officially documented in SDM, since at least rev. 085, October 2024. Tested in simics.
Details
Details
- Reviewers
alc markj - Commits
- rG89589b6d3fba: amd64: add LASS support
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| sys/x86/x86/mp_x86.c | ||
|---|---|---|
| 1135 ↗ | (On Diff #171747) | This part of the change can be dropped I think. |
Comment Actions
We'll want to add a note to mitigations(7) as well; I can take a look at that.
| sys/amd64/amd64/initcpu.c | ||
|---|---|---|
| 294 | Let's expand LASS once on first use - Linear Address Space Separation (LASS). Where we fetch the tunable seems as good a place as any. | |
Comment Actions
Note that this is not quite a mitigation. It is more a switch that makes CPU accept the typical, of not only, UVA/KVA layout used on amd64.
But indeed, LASS short-circuits even a possibility for things like meltdown.