linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmap.2: mmap with address NULL and MAP_FIXED results in EPERM
@ 2017-06-15 19:09 Theodore Dubois
  2017-06-16 15:25 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Theodore Dubois @ 2017-06-15 19:09 UTC (permalink / raw)
  To: mtk.manpages; +Cc: linux-man, linux-kernel, Theodore Dubois

This can be verified with a simple test program. I'm not sure if this is
a kernel bug or a documentation bug, though...
---
 man2/mmap.2 | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/man2/mmap.2 b/man2/mmap.2
index d1942b52a..58361c837 100644
--- a/man2/mmap.2
+++ b/man2/mmap.2
@@ -515,6 +515,13 @@ was mounted no-exec.
 .\" (Since 2.4.25 / 2.6.0.)
 .TP
 .B EPERM
+The
+.I addr
+argument is 0 and
+.B MAP_FIXED
+is specified.
+.TP
+.B EPERM
 The operation was prevented by a file seal; see
 .BR fcntl (2).
 .TP
-- 
2.13.1

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

* Re: [PATCH] mmap.2: mmap with address NULL and MAP_FIXED results in EPERM
  2017-06-15 19:09 [PATCH] mmap.2: mmap with address NULL and MAP_FIXED results in EPERM Theodore Dubois
@ 2017-06-16 15:25 ` Michal Hocko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2017-06-16 15:25 UTC (permalink / raw)
  To: Theodore Dubois; +Cc: mtk.manpages, linux-man, linux-kernel

On Thu 15-06-17 12:09:01, Theodore Dubois wrote:
> This can be verified with a simple test program. I'm not sure if this is
> a kernel bug or a documentation bug, though...

THis is not a bug. You are not allowed to mmap anything below
/proc/sys/vm/mmap_min_addr. So your patch to update documentation would
have to mention this sysctl to be correct.

> ---
>  man2/mmap.2 | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/man2/mmap.2 b/man2/mmap.2
> index d1942b52a..58361c837 100644
> --- a/man2/mmap.2
> +++ b/man2/mmap.2
> @@ -515,6 +515,13 @@ was mounted no-exec.
>  .\" (Since 2.4.25 / 2.6.0.)
>  .TP
>  .B EPERM
> +The
> +.I addr
> +argument is 0 and
> +.B MAP_FIXED
> +is specified.
> +.TP
> +.B EPERM
>  The operation was prevented by a file seal; see
>  .BR fcntl (2).
>  .TP
> -- 
> 2.13.1

-- 
Michal Hocko
SUSE Labs

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

end of thread, other threads:[~2017-06-16 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 19:09 [PATCH] mmap.2: mmap with address NULL and MAP_FIXED results in EPERM Theodore Dubois
2017-06-16 15:25 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).