Page MenuHomeFreeBSD

Preserve ASLR vm_map flags across fork.
ClosedPublic

Authored by brooks on Aug 5 2020, 7:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 25, 2:20 AM
Unknown Object (File)
Fri, Jul 24, 8:56 PM
Unknown Object (File)
Fri, Jul 24, 2:21 PM
Unknown Object (File)
Mon, Jul 20, 10:17 AM
Unknown Object (File)
Mon, Jul 13, 9:39 AM
Unknown Object (File)
Tue, Jun 30, 1:03 AM
Unknown Object (File)
Jun 28 2026, 4:53 AM
Unknown Object (File)
Jun 25 2026, 2:47 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

brooks requested review of this revision.Aug 5 2020, 7:50 PM
brooks created this revision.
sys/vm/vm_map.c
4102 ↗(On Diff #75448)

() 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.