lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171202021626.26478-1-jhubbard@nvidia.com>
Date:   Fri,  1 Dec 2017 18:16:26 -0800
From:   john.hubbard@...il.com
To:     Michael Kerrisk <mtk.manpages@...il.com>
Cc:     linux-man <linux-man@...r.kernel.org>, linux-api@...r.kernel.org,
        Michael Ellerman <mpe@...erman.id.au>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>, linux-arch@...r.kernel.org,
        Michal Hocko <mhocko@...e.com>,
        John Hubbard <jhubbard@...dia.com>
Subject: [PATCH] mmap.2: MAP_FIXED is no longer discouraged

From: John Hubbard <jhubbard@...dia.com>

MAP_FIXED has been widely used for a very long time, yet the man
page still claims that "the use of this option is discouraged".

The documentation assumes that "less portable" == "must be discouraged".

Instead of discouraging something that is so useful and widely used,
change the documentation to explain its limitations better.

Signed-off-by: John Hubbard <jhubbard@...dia.com>
---
While reviewing Michal Hocko's man page update for MAP_FIXED_SAFE,
I noticed that MAP_FIXED was no longer reflecting the current
situation, so here is a patch to bring it into the year 2017.

 man2/mmap.2 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/man2/mmap.2 b/man2/mmap.2
index 385f3bfd5..a5a8eb47a 100644
--- a/man2/mmap.2
+++ b/man2/mmap.2
@@ -222,8 +222,10 @@ part of the existing mapping(s) will be discarded.
 If the specified address cannot be used,
 .BR mmap ()
 will fail.
-Because requiring a fixed address for a mapping is less portable,
-the use of this option is discouraged.
+Software that aspires to be portable should use this option with care, keeping
+in mind that the exact layout of a process' memory map is allowed to change
+significantly between kernel versions, C library versions, and operating system
+releases.
 .TP
 .B MAP_GROWSDOWN
 This flag is used for stacks.
-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ