Geoff Clare
2014-08-07 09:04:43 UTC
Subject: Minutes of the 24 July 2014 Teleconference
[...]Bug #852: Clarify MAP_FIXED semantics when replacing existing locked mappings OPEN
http://www.austingroupbugs.net/view.php?id=852
This item was discussed at length, but not yet closed.
[...]http://www.austingroupbugs.net/view.php?id=852
This item was discussed at length, but not yet closed.
If an application requests a mapping that would overlay existing
mappings in the process, it might be desirable that an
implementation detect this and inform the application. However,
the default, portable (not MAP_FIXED) operation does not overlay
existing mappings. On the other hand, if the program specifies
a fixed address mapping (which requires some implementation
knowledge to determine a suitable address, if the function is
supported at all), then the program is presumed to be successfully
managing its own address space and should be trusted when it
asks to map over existing data structures. Furthermore, it is
also desirable to make as few system calls as possible, and it
might be considered onerous to require an munmap() before an
mmap() to the same address range. This volume of POSIX.1-2008
specifies that the new mappings replace any existing mappings,
following existing practice in this regard.
If an application requests a mapping that overlaps existing
mappings in the process, it might be desirable that an
implementation detect this and inform the application. However,
if the program specifies a fixed address mapping (which requires
some implementation knowledge to determine a suitable address,
if the function is supported at all), then the program is
presumed to be successfully managing its own address space and
should be trusted when it asks to map over existing data
structures. Furthermore, it is also desirable to make as few
system calls as possible, and it might be considered onerous
to require an munmap() before an mmap() to the same address
range. This volume of POSIX.1-2008 specifies that the new
mapping replaces any existing mappings (implying an automatic
munmap() on the address range) , following existing practice
in this regard.
TODO: Try to keep the term "overlay mapping"
I suggest appending a sentence to the new version of this paragraph:mappings in the process, it might be desirable that an
implementation detect this and inform the application. However,
the default, portable (not MAP_FIXED) operation does not overlay
existing mappings. On the other hand, if the program specifies
a fixed address mapping (which requires some implementation
knowledge to determine a suitable address, if the function is
supported at all), then the program is presumed to be successfully
managing its own address space and should be trusted when it
asks to map over existing data structures. Furthermore, it is
also desirable to make as few system calls as possible, and it
might be considered onerous to require an munmap() before an
mmap() to the same address range. This volume of POSIX.1-2008
specifies that the new mappings replace any existing mappings,
following existing practice in this regard.
If an application requests a mapping that overlaps existing
mappings in the process, it might be desirable that an
implementation detect this and inform the application. However,
if the program specifies a fixed address mapping (which requires
some implementation knowledge to determine a suitable address,
if the function is supported at all), then the program is
presumed to be successfully managing its own address space and
should be trusted when it asks to map over existing data
structures. Furthermore, it is also desirable to make as few
system calls as possible, and it might be considered onerous
to require an munmap() before an mmap() to the same address
range. This volume of POSIX.1-2008 specifies that the new
mapping replaces any existing mappings (implying an automatic
munmap() on the address range) , following existing practice
in this regard.
TODO: Try to keep the term "overlay mapping"
The standard developers also considered whether there should be
a way for new mappings to overlay existing mappings, but found
no existing practice for this.
--
Geoff Clare <g.clare-7882/***@public.gmane.org>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England
Geoff Clare <g.clare-7882/***@public.gmane.org>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England