Skip to content

fix(zone): keep the kernel's mmap and brk randomization defaults - #294

Merged
kdaula merged 1 commit into
mainfrom
kavi/cor-196-zone-aslr-defaults
Nov 4, 2026
Merged

kdaula merged 1 commit into
mainfrom
kavi/cor-196-zone-aslr-defaults

Conversation

@kdaula

@kdaula kdaula commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Zone kernels run with the minimum mmap entropy, 28 bits on x86_64 and 18 on arm64, and x86_64 zones have no brk randomization at all. Host kernels get the maximum.

Edera's kernel makes the maximum mmap entropy the default, but zone.config still pins CONFIG_ARCH_MMAP_RND_BITS and CONFIG_ARCH_MMAP_RND_COMPAT_BITS to the old minimums, and CONFIG_EXPERT=y makes those pinned values win. The x86_64 zone also sets CONFIG_COMPAT_BRK=y, which boots with randomize_va_space=1 and leaves brk unrandomized. This drops the pinned values and COMPAT_BRK, matching the host configs. Configuring the x86_64 zone kernel with this change gives 32 mmap bits, 16 compat bits and COMPAT_BRK off.

COR-196

The zone configs pinned CONFIG_ARCH_MMAP_RND_BITS and its compat
counterpart to the architecture minimums, and with CONFIG_EXPERT=y those
values override the kernel's default of the maximum. x86_64 zones also
set CONFIG_COMPAT_BRK=y, which boots with randomize_va_space=1 and turns
brk randomization off. Drop the pinned values and COMPAT_BRK, as the host
configs already do.
@kdaula
kdaula marked this pull request as ready for review November 4, 2026 01:52
@kaniini

kaniini commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

while this is an improvement, we should want to default zones to using the maximum amount of entropy to make ASLR more effective as a mitigation.

@kaniini

kaniini commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

oh it does precisely that, but the PR description wasn't clear to me at 7:50am

@kdaula
kdaula merged commit 95b86eb into main Nov 4, 2026
18 checks passed
@kdaula
kdaula deleted the kavi/cor-196-zone-aslr-defaults branch November 4, 2026 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants