Page MenuHomeFreeBSD

Preserve ASLR vm_map flags across fork.
ClosedPublic

Authored by brooks on Aug 5 2020, 7:50 PM.
Tags
None
Referenced Files
F102989216: D25966.diff
Tue, Nov 19, 1:14 PM
Unknown Object (File)
Thu, Oct 31, 5:28 PM
Unknown Object (File)
Oct 3 2024, 1:50 AM
Unknown Object (File)
Sep 28 2024, 2:55 PM
Unknown Object (File)
Sep 24 2024, 4:21 AM
Unknown Object (File)
Sep 4 2024, 9:33 AM
Unknown Object (File)
Sep 4 2024, 7:38 AM
Unknown Object (File)
Aug 30 2024, 12:54 PM
Subscribers

Details

Summary

In the most common case (fork+execve) this doesn't matter, but further
attempts to apply entropy would fail in (e.g.) a pre-fork server.

Reported by: Alfredo Mazzinghi

Test Plan

A variant of this patch preserving an additional local flag
works in CheriBSD.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32783
Build 30215: arc lint + arc unit

Event Timeline

brooks requested review of this revision.Aug 5 2020, 7:50 PM
brooks created this revision.
sys/vm/vm_map.c
4102

() are excessive.
Also I suggest to move the line right after new_map assignment (line 4098), no need for blank lines around.

sys/vm/vm_map.h
226 ↗(On Diff #75448)

It is single-use symbol, it is easier to read code when flags are listed explicitly in vmspace_fork().

  • Relocate flags assignment and don't use a variable.
This revision is now accepted and ready to land.Aug 5 2020, 9:11 PM
This revision was automatically updated to reflect the committed changes.