public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] man/man2/mmap.2: Further document MAP_GROWSDOWN
@ 2026-01-26 18:13 Ben Kallus
  2026-01-26 22:35 ` Alejandro Colomar
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Kallus @ 2026-01-26 18:13 UTC (permalink / raw)
  To: alx; +Cc: linux-man, Ben Kallus

Makes 2 corrections to the page:
1. mmap(MAP_GROWSDOWN) returns the base address of the returned
   mapping; not one page lower than that.
2. When growing a MAP_GROWSDOWN mapping, the kernel doesn't require that
   the faulting access be within the guard page. Instead, it just needs
   to be beneath the mapping, and not within `stack_guard_gap` of the
   next lower mapping. By default, `stack_guard_gap` is 256.
---
 man/man2/mmap.2 | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/man/man2/mmap.2 b/man/man2/mmap.2
index 093b0caf1..be2b21ccc 100644
--- a/man/man2/mmap.2
+++ b/man/man2/mmap.2
@@ -274,13 +274,11 @@ should check the returned address against the requested address.
 This flag is used for stacks.
 It indicates to the kernel virtual memory system that the mapping
 should extend downward in memory.
-The return address is one page lower than the memory area that is
-actually created in the process's virtual address space.
-Touching an address in the "guard" page below the mapping will cause
-the mapping to grow by a page.
-This growth can be repeated until the mapping grows to within a
-page of the high end of the next lower mapping,
-at which point touching the "guard" page will result in a
+Accessing an address in the pages below the mapping will cause the mapping
+to grow to accommodate the access.
+This growth can be repeated until the mapping grows to within
+256 pages of the high end of the next lower mapping, at which point touching
+below the mapping will result in a
 .B SIGSEGV
 signal.
 .TP
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-27 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-26 18:13 [PATCH] man/man2/mmap.2: Further document MAP_GROWSDOWN Ben Kallus
2026-01-26 22:35 ` Alejandro Colomar
2026-01-27 14:22   ` Ben Kallus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox