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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat,  2 Apr 2016 21:17:32 +0200
From:	Piotr Kwapulinski <kwapulinski.piotr@...il.com>
To:	akpm@...ux-foundation.org
Cc:	mhocko@...e.com, mtk.manpages@...il.com, cmetcalf@...lanox.com,
	arnd@...db.de, viro@...iv.linux.org.uk, mszeredi@...e.cz,
	dave@...olabs.net, kirill.shutemov@...ux.intel.com, vbabka@...e.cz,
	mingo@...nel.org, dan.j.williams@...el.com,
	dave.hansen@...ux.intel.com, koct9i@...il.com, hannes@...xchg.org,
	jack@...e.cz, xiexiuqi@...wei.com, iamjoonsoo.kim@....com,
	oleg@...hat.com, gang.chen.5i5j@...il.com, aarcange@...hat.com,
	aryabinin@...tuozzo.com, rientjes@...gle.com, denc716@...il.com,
	toshi.kani@....com, ldufour@...ux.vnet.ibm.com,
	kuleshovmail@...il.com, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, linux-arch@...r.kernel.org,
	Piotr Kwapulinski <kwapulinski.piotr@...il.com>
Subject: [PATCH 1/3] man/mmap.2: don't unmap the overlapping VMA(s)

mmap.2 man page update for MAP_DONTUNMAP flag of mmap.

Signed-off-by: Piotr Kwapulinski <kwapulinski.piotr@...il.com>
---
It should be considered to be merged only in case the patch
"[PATCH 0/3] mm/mmap.c: don't unmap the overlapping VMA(s)"
is merged.
---
 man2/mmap.2 | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/man2/mmap.2 b/man2/mmap.2
index 0f2f277..0fc5879 100644
--- a/man2/mmap.2
+++ b/man2/mmap.2
@@ -37,7 +37,7 @@
 .\" 2007-07-10, mtk, Added an example program.
 .\" 2008-11-18, mtk, document MAP_STACK
 .\"
-.TH MMAP 2 2016-03-15 "Linux" "Linux Programmer's Manual"
+.TH MMAP 2 2016-04-02 "Linux" "Linux Programmer's Manual"
 .SH NAME
 mmap, munmap \- map or unmap files or devices into memory
 .SH SYNOPSIS
@@ -213,7 +213,9 @@ If the memory region specified by
 .I addr
 and
 .I len
-overlaps pages of any existing mapping(s), then the overlapped
+overlaps pages of any existing mapping(s) and
+.B MAP_DONTUNMAP
+is not set, then the overlapped
 part of the existing mapping(s) will be discarded.
 If the specified address cannot be used,
 .BR mmap ()
@@ -221,6 +223,23 @@ will fail.
 Because requiring a fixed address for a mapping is less portable,
 the use of this option is discouraged.
 .TP
+.BR MAP_DONTUNMAP " (since Linux 4.6)"
+If this flag and
+.B MAP_FIXED
+are set and the memory region specified by
+.I addr
+and
+.I length
+overlaps pages of any existing mapping(s), then the
+.BR mmap ()
+will fail with
+.BR ENOMEM .
+No existing mapping(s) will be
+discarded.
+
+Note: currently, this flag is not implemented in the glibc wrapper.
+Use the numerical hex value 40, if you want to use it.
+.TP
 .B MAP_GROWSDOWN
 Used for stacks.
 Indicates to the kernel virtual memory system that the mapping
@@ -477,6 +496,15 @@ No memory is available.
 .TP
 .B ENOMEM
 The process's maximum number of mappings would have been exceeded.
+Or, both the
+.B MAP_FIXED
+and
+.B MAP_DONTUNMAP
+flags are set and the memory region specified by
+.I addr
+and
+.I length
+overlaps pages of any existing mapping(s).
 This error can also occur for
 .BR munmap (2),
 when unmapping a region in the middle of an existing mapping,
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ