Page MenuHomeFreeBSD

mmap(2): Document guard size and related EINVAL.
ClosedPublic

Authored by kib on Oct 21 2020, 5:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 3, 4:36 AM
Unknown Object (File)
Dec 23 2023, 1:09 AM
Unknown Object (File)
Oct 27 2023, 12:04 AM
Unknown Object (File)
Jul 19 2023, 1:32 AM
Unknown Object (File)
Jul 13 2023, 8:23 PM
Unknown Object (File)
Jul 9 2023, 8:18 PM
Unknown Object (File)
Jul 1 2023, 9:52 PM
Unknown Object (File)
Jul 1 2023, 9:50 PM
Subscribers

Details

Diff Detail

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

Event Timeline

kib requested review of this revision.Oct 21 2020, 5:48 PM
emaste added inline comments.
lib/libc/sys/mmap.2
354 ↗(On Diff #78559)

The size of the guard, in pages, ...

460 ↗(On Diff #78559)

less than or equal to

This revision is now accepted and ready to land.Oct 21 2020, 6:30 PM
kib marked 2 inline comments as done.

Handle Ed' notes.
Use .Dv for sysctl mib name.
Bump date.

This revision now requires review to proceed.Oct 21 2020, 6:37 PM
This revision is now accepted and ready to land.Oct 21 2020, 6:57 PM
lib/libc/sys/mmap.2
456 ↗(On Diff #78560)

Didn't the mailing list report mention ENOMEM?

markj added inline comments.
lib/libc/sys/mmap.2
456 ↗(On Diff #78560)

Sorry, I did not read the full thread.

head/lib/libc/sys/mmap.2
354–355

IMHO, we should be explicitly saying that the guard is carved out the specified stack size, reducing the effective size of the stack. Right now, I could infer that from reading the errors section, but I argue that I shouldn't have to infer it.

head/lib/libc/sys/mmap.2
354–355

good point, how's this:

Index: lib/libc/sys/mmap.2
===================================================================
--- lib/libc/sys/mmap.2 (revision 366945)
+++ lib/libc/sys/mmap.2 (working copy)
@@ -353,6 +353,8 @@
 stacks can grow without requiring mapping the whole stack in advance.
 The size of the guard, in pages, is specified by sysctl
 .Dv security.bsd.stack_guard_page .
+The guard region is placed at the starting address of the allocation,
+and the usable stack is reduced by the size of the guard.
 .El
 .Pp
 The