Re: [PATCH v2] prctl: Deprecate non PR_SET_MM_MAP operations

From: Cyrill Gorcunov
Date: Thu Apr 05 2018 - 15:52:05 EST


On Thu, Apr 05, 2018 at 08:56:50PM +0200, Michal Hocko wrote:
> On Thu 05-04-18 21:26:51, Cyrill Gorcunov wrote:
> > An ability to manipulate mm_struct fields was introduced in
> > sake of CRIU in first place. Later we provide more suitable
> > and safe operation PR_SET_MM_MAP where all fields to be modifed
> > are passed in one structure which allows us to make more detailed
> > verification.
>
> I hope this will serve as a memento for future single-user APIs
> proposals. The whole thing was a bad idea since the beginning.

It wasn't a bad idea at all, kernel evolves with time and the
first version of the api served as it should (actually a number
of things get involved like user-namespaces, mm reworks and
such things). So no, it wasn't bad. Rather to make it more
suitable we provided a second version of the api.

> > Still old interface remains present for compatibility reason
> > though CRIU itself already switched to PR_SET_MM_MAP on its
> > own long ago.
> >
> > Googling didn't reveal some other users of this operation
> > so I think it should be safe to remove this interface.
> >
> > v2:
> > - Improve warning message
> > - Drop redundant args check
> >
> > CC: Andrey Vagin <avagin@xxxxxxxxxx>
> > CC: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxx>
> > CC: Pavel Emelyanov <xemul@xxxxxxxxxxxxx>
> > CC: Michael Kerrisk <mtk.manpages@xxxxxxxxx>
> > CC: Yang Shi <yang.shi@xxxxxxxxxxxxxxxxx>
> > CC: Michal Hocko <mhocko@xxxxxxxxxx>
> > Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxx>
>
> Acked-by: Michal Hocko <mhocko@xxxxxxxx>
>
> and fingers crossed that we haven't grown other users outside of CRIU
> which is quite bound to specific kernels AFAIK.

Surely.