Skip to content

mmap() and mremap() security fixes#2143

Merged
francescolavra merged 2 commits intomasterfrom
fix/mmap
Mar 7, 2026
Merged

mmap() and mremap() security fixes#2143
francescolavra merged 2 commits intomasterfrom
fix/mmap

Conversation

@francescolavra
Copy link
Member

The first commit adds a missing validation of the user-supplied address in the mremap() syscall.
The second commit enforces read-only access on executable mappings when exec protection is enabled.

Thanks to Niklas Femerstrand (@niklasfemerstrand) for reporting these issues.

Francesco Lavra added 2 commits March 7, 2026 08:02
The target address range in a mremap syscall with the MREMAP_FIXED flag
must fall within the range assigned to the user process, otherwise the
syscall must be rejected with -EINVAL;
When exec protection is enabled, a mapping for an executable file must
never be granted write access, even if it's a private mapping, otherwise a
program can bypass exec protection by executing arbitrary code in memory.
@francescolavra francescolavra merged commit 4d61547 into master Mar 7, 2026
7 checks passed
@francescolavra francescolavra deleted the fix/mmap branch March 7, 2026 07:32
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