[PATCH] man/man2/mmap.2: Further document MAP_GROWSDOWN
From: Ben Kallus <hidden>
Date: 2026-01-26 18:13:14
Subsystem:
the rest · Maintainer:
Linus Torvalds
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