* [PATCH] man/man2/mmap.2: Document MAP_GROWSDOWN return val
@ 2026-01-27 14:25 Ben Kallus
2026-01-27 22:03 ` Alejandro Colomar
0 siblings, 1 reply; 4+ messages in thread
From: Ben Kallus @ 2026-01-27 14:25 UTC (permalink / raw)
To: alx; +Cc: linux-man, Ben Kallus
Previously, the man page stated that the MAP_GROWSDOWN flag causes the
kernel to return an address one page lower than the mapping created.
This is not true; the kernel returns the base address of the mapping
created. This can be confirmed by inspecting /proc/self/maps after
making a gd mapping, and comparing it to the returned value from mmap.
Signed-off-by: Ben Kallus <benjamin.p.kallus.gr@dartmouth.edu>
---
man/man2/mmap.2 | 2 --
1 file changed, 2 deletions(-)
diff --git a/man/man2/mmap.2 b/man/man2/mmap.2
index 093b0caf1..9bfa88a65 100644
--- a/man/man2/mmap.2
+++ b/man/man2/mmap.2
@@ -274,8 +274,6 @@ 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
--
2.52.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] man/man2/mmap.2: Document MAP_GROWSDOWN return val
2026-01-27 14:25 [PATCH] man/man2/mmap.2: Document MAP_GROWSDOWN return val Ben Kallus
@ 2026-01-27 22:03 ` Alejandro Colomar
2026-01-28 1:14 ` Ben Kallus
0 siblings, 1 reply; 4+ messages in thread
From: Alejandro Colomar @ 2026-01-27 22:03 UTC (permalink / raw)
To: Ben Kallus; +Cc: linux-man
[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]
Hi Ben,
On 2026-01-27T09:25:45-0500, Ben Kallus wrote:
> Previously, the man page stated that the MAP_GROWSDOWN flag causes the
> kernel to return an address one page lower than the mapping created.
> This is not true; the kernel returns the base address of the mapping
> created. This can be confirmed by inspecting /proc/self/maps after
> making a gd mapping, and comparing it to the returned value from mmap.
>
> Signed-off-by: Ben Kallus <benjamin.p.kallus.gr@dartmouth.edu>
> ---
> man/man2/mmap.2 | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/man/man2/mmap.2 b/man/man2/mmap.2
> index 093b0caf1..9bfa88a65 100644
> --- a/man/man2/mmap.2
> +++ b/man/man2/mmap.2
> @@ -274,8 +274,6 @@ 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 patch only removes code. Is this accidental or intended? I think
this does not match the commit subject (which BTW has a cut word?)
Have a lovely day!
Alex
> the mapping to grow by a page.
> This growth can be repeated until the mapping grows to within a
> --
> 2.52.0
>
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] man/man2/mmap.2: Document MAP_GROWSDOWN return val
2026-01-27 22:03 ` Alejandro Colomar
@ 2026-01-28 1:14 ` Ben Kallus
2026-02-10 23:39 ` Alejandro Colomar
0 siblings, 1 reply; 4+ messages in thread
From: Ben Kallus @ 2026-01-28 1:14 UTC (permalink / raw)
To: Alejandro Colomar; +Cc: linux-man
Hi Alex,
> The patch only removes code. Is this accidental or intended? I think
> this does not match the commit subject (which BTW has a cut word?)
This is intended.
Basically this patch just removes an incorrect statement about the
address returned by mmap when the MAP_GROWSDOWN flag is passed. I
could make the subject line more specific if you'd prefer. Also happy
to change "val" to "value" if the shorthand isn't sufficiently clear.
Thanks,
Ben
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] man/man2/mmap.2: Document MAP_GROWSDOWN return val
2026-01-28 1:14 ` Ben Kallus
@ 2026-02-10 23:39 ` Alejandro Colomar
0 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2026-02-10 23:39 UTC (permalink / raw)
To: Ben Kallus; +Cc: linux-man
[-- Attachment #1: Type: text/plain, Size: 704 bytes --]
Hi Ben,
On 2026-01-28T01:14:11+0000, Ben Kallus wrote:
> Hi Alex,
>
> > The patch only removes code. Is this accidental or intended? I think
> > this does not match the commit subject (which BTW has a cut word?)
>
> This is intended.
>
> Basically this patch just removes an incorrect statement about the
> address returned by mmap when the MAP_GROWSDOWN flag is passed. I
> could make the subject line more specific if you'd prefer. Also happy
> to change "val" to "value" if the shorthand isn't sufficiently clear.
Yes, please, send the patch with a more specific commit subject.
Have a lovely night!
Alex
>
> Thanks,
> Ben
--
<https://www.alejandro-colomar.es>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-02-10 23:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-27 14:25 [PATCH] man/man2/mmap.2: Document MAP_GROWSDOWN return val Ben Kallus
2026-01-27 22:03 ` Alejandro Colomar
2026-01-28 1:14 ` Ben Kallus
2026-02-10 23:39 ` Alejandro Colomar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox