[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171207120735.GA24547@atrey.karlin.mff.cuni.cz>
Date: Thu, 7 Dec 2017 13:07:35 +0100
From: Pavel Machek <pavel@....cz>
To: Michal Hocko <mhocko@...nel.org>
Cc: linux-api@...r.kernel.org, Khalid Aziz <khalid.aziz@...cle.com>,
Michael Ellerman <mpe@...erman.id.au>,
Andrew Morton <akpm@...ux-foundation.org>,
Russell King - ARM Linux <linux@...linux.org.uk>,
Andrea Arcangeli <aarcange@...hat.com>, linux-mm@...ck.org,
LKML <linux-kernel@...r.kernel.org>, linux-arch@...r.kernel.org,
Florian Weimer <fweimer@...hat.com>,
John Hubbard <jhubbard@...dia.com>,
Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH 1/2] mm: introduce MAP_FIXED_SAFE
Hi!
> MAP_FIXED is used quite often to enforce mapping at the particular
> range. The main problem of this flag is, however, that it is inherently
> dangerous because it unmaps existing mappings covered by the requested
> range. This can cause silent memory corruptions. Some of them even with
> serious security implications. While the current semantic might be
> really desiderable in many cases there are others which would want to
> enforce the given range but rather see a failure than a silent memory
> corruption on a clashing range. Please note that there is no guarantee
> that a given range is obeyed by the mmap even when it is free - e.g.
> arch specific code is allowed to apply an alignment.
>
> Introduce a new MAP_FIXED_SAFE flag for mmap to achieve this behavior.
> It has the same semantic as MAP_FIXED wrt. the given address request
Could we get some better name? Functionality seems reasonable, but
_SAFE suffix does not really explain what is going on to the user.
MAP_ADD_FIXED ?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Powered by blists - more mailing lists