Page MenuHomeFreeBSD

execve: Add guard pages around execve KVA buffers
ClosedPublic

Authored by markj on Wed, Apr 29, 3:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 26, 8:16 AM
Unknown Object (File)
Tue, May 26, 8:09 AM
Unknown Object (File)
Tue, May 26, 1:21 AM
Unknown Object (File)
Tue, May 26, 1:11 AM
Unknown Object (File)
Tue, May 19, 9:35 PM
Unknown Object (File)
Mon, May 18, 12:07 AM
Unknown Object (File)
Mon, May 18, 12:03 AM
Unknown Object (File)
Sat, May 16, 11:58 AM
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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Wed, Apr 29, 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.Mon, May 4, 7:06 AM