Re: [PATCH 2/2] mmap.2: MAP_FIXED updated documentation

From: Michal Hocko
Date: Wed Dec 13 2017 - 08:35:57 EST


On Wed 13-12-17 14:21:05, Pavel Machek wrote:
> On Wed 2017-12-13 14:16:40, Michal Hocko wrote:
> > On Wed 13-12-17 14:09:00, Pavel Machek wrote:
> > > On Wed 2017-12-13 14:04:58, Michal Hocko wrote:
> > > > On Wed 13-12-17 13:55:40, Pavel Machek wrote:
> > > > > On Wed 2017-12-13 10:31:10, Michal Hocko wrote:
> > > > > > From: John Hubbard <jhubbard@xxxxxxxxxx>
> > > > > >
> > > > > > -- Expand the documentation to discuss the hazards in
> > > > > > enough detail to allow avoiding them.
> > > > > >
> > > > > > -- Mention the upcoming MAP_FIXED_SAFE flag.
> > > > >
> > > > > Pretty map everyone agreed MAP_FIXED_SAFE was a bad
> > > > > name. MAP_FIXED_NOREPLACE (IIRC) was best replacement.
> > > >
> > > > Please read http://lkml.kernel.org/r/20171213092550.2774-1-mhocko@xxxxxxxxxx
> > >
> > > Please fix your patches according to the feedback...
> > >
> > > NACCKED-by: Pavel Machek <pavel@xxxxxx>
> >
> > Good luck pursuing this further then. I am not going to spend time on
> > naming bikeheds. I have more pressing stuff to work on.
>
> You selected stupid name for a flag. Everyone and their dog agrees
> with that.

Not sure about your dog but mine says that a flag which fixes an
_unsafe_ aspects of MAP_FIXED can be called MAP_FIXED_SAFE just fine.

Anyway, I am not going to argue about this further. I've implemented the
code, gathered uscases and fortified an in-kernel user which already led
to a security issue in the past. I consider my part done here. I do not
agree that MAP_FIXED_NOREPLACE would be so much better to respin and
then deal with what about this MAP_$FOO. If there are really stong
feelings about this then feel free to take these patches, do
s@MAP_FIXED_SAFE@MAP_$FOO@ and try to upstream them yourself.
--
Michal Hocko
SUSE Labs