Page MenuHomeFreeBSD

execve: Add guard pages around execve KVA buffers
ClosedPublic

Authored by markj on Apr 29 2026, 3:07 PM.
Tags
None
Referenced Files
F172471365: D56711.id176812.diff
Fri, Sep 18, 5:12 PM
F172470847: D56711.id177119.diff
Fri, Sep 18, 5:06 PM
F172470760: D56711.id177178.diff
Fri, Sep 18, 5:05 PM
F172453451: D56711.diff
Fri, Sep 18, 2:12 PM
Unknown Object (File)
Tue, Sep 15, 11:10 PM
Unknown Object (File)
Fri, Sep 11, 2:56 AM
Unknown Object (File)
Fri, Sep 11, 1:54 AM
Unknown Object (File)
Thu, Sep 10, 7:46 PM
Subscribers

Details

Summary

This helps ensure that overflows will trigger a panic instead of
silently corrupting adjacent buffers, as happened in SA-26:13.exec.

Extend kmap_alloc_wait() to support allocation of guard pages on both
sides of a KVA allocation. Modify the exec_map setup accordingly.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 72746
Build 69629: arc lint + arc unit

Event Timeline

markj requested review of this revision.Apr 29 2026, 3:07 PM
sys/vm/vm_init.c
277

I wonder if exec_map_guard_size should be allowed to set to 0. This might matter on 32bit arches.

sys/vm/vm_init.c
277

Or at least we could export exec_map_entr* as RO sysctls to get more visibility there.

markj marked 2 inline comments as done.

Add a tunable to control the number of guard pages

This revision is now accepted and ready to land.May 4 2026, 7:06 AM