* [RFC] prctl: Deprecate non PR_SET_MM_MAP operations
@ 2018-04-03 22:37 Cyrill Gorcunov
2018-04-03 23:15 ` Yang Shi
0 siblings, 1 reply; 6+ messages in thread
From: Cyrill Gorcunov @ 2018-04-03 22:37 UTC (permalink / raw)
To: LKML
Cc: Andrey Vagin, Andrew Morton, Pavel Emelyanov, Michael Kerrisk,
Yang Shi, Michal Hocko
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.
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 issue deprecation warning
first time and get rid of this interface after a couple
of releases.
CC: Andrey Vagin <avagin@openvz.org>
CC: Andrew Morton <akpm@linuxfoundation.org>
CC: Pavel Emelyanov <xemul@virtuozzo.com>
CC: Michael Kerrisk <mtk.manpages@gmail.com>
CC: Yang Shi <yang.shi@linux.alibaba.com>
CC: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
Or we can simply drop it off because PR_SET_MM_MAP covers all needs,
and I would rather prefer to do that asap.
kernel/sys.c | 2 ++
1 file changed, 2 insertions(+)
Index: linux-ml.git/kernel/sys.c
===================================================================
--- linux-ml.git.orig/kernel/sys.c
+++ linux-ml.git/kernel/sys.c
@@ -2052,6 +2052,8 @@ static int prctl_set_mm(int opt, unsigne
if (!capable(CAP_SYS_RESOURCE))
return -EPERM;
+ pr_warn_once("Non PR_SET_MM_MAP operations are deprecated\n");
+
if (opt == PR_SET_MM_EXE_FILE)
return prctl_set_mm_exe_file(mm, (unsigned int)addr);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] prctl: Deprecate non PR_SET_MM_MAP operations
2018-04-03 22:37 [RFC] prctl: Deprecate non PR_SET_MM_MAP operations Cyrill Gorcunov
@ 2018-04-03 23:15 ` Yang Shi
2018-04-04 5:35 ` Michal Hocko
0 siblings, 1 reply; 6+ messages in thread
From: Yang Shi @ 2018-04-03 23:15 UTC (permalink / raw)
To: Cyrill Gorcunov, LKML
Cc: Andrey Vagin, Andrew Morton, Pavel Emelyanov, Michael Kerrisk,
Michal Hocko
On 4/3/18 3:37 PM, 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.
>
> 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 issue deprecation warning
> first time and get rid of this interface after a couple
> of releases.
>
> CC: Andrey Vagin <avagin@openvz.org>
> CC: Andrew Morton <akpm@linuxfoundation.org>
> CC: Pavel Emelyanov <xemul@virtuozzo.com>
> CC: Michael Kerrisk <mtk.manpages@gmail.com>
> CC: Yang Shi <yang.shi@linux.alibaba.com>
> CC: Michal Hocko <mhocko@kernel.org>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
> Or we can simply drop it off because PR_SET_MM_MAP covers all needs,
> and I would rather prefer to do that asap.
Thanks for making it deprecated. I'd prefer just drop it off if nobody
objects. The change will get soaked in linux-next for a while , we will
know if it breaks compatibility (it sounds very unlikely).
Yang
>
> kernel/sys.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> Index: linux-ml.git/kernel/sys.c
> ===================================================================
> --- linux-ml.git.orig/kernel/sys.c
> +++ linux-ml.git/kernel/sys.c
> @@ -2052,6 +2052,8 @@ static int prctl_set_mm(int opt, unsigne
> if (!capable(CAP_SYS_RESOURCE))
> return -EPERM;
>
> + pr_warn_once("Non PR_SET_MM_MAP operations are deprecated\n");
> +
> if (opt == PR_SET_MM_EXE_FILE)
> return prctl_set_mm_exe_file(mm, (unsigned int)addr);
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] prctl: Deprecate non PR_SET_MM_MAP operations
2018-04-03 23:15 ` Yang Shi
@ 2018-04-04 5:35 ` Michal Hocko
2018-04-04 6:59 ` Cyrill Gorcunov
2018-04-04 15:54 ` Yang Shi
0 siblings, 2 replies; 6+ messages in thread
From: Michal Hocko @ 2018-04-04 5:35 UTC (permalink / raw)
To: Yang Shi
Cc: Cyrill Gorcunov, LKML, Andrey Vagin, Andrew Morton,
Pavel Emelyanov, Michael Kerrisk
On Tue 03-04-18 16:15:20, Yang Shi wrote:
>
>
> On 4/3/18 3:37 PM, 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.
> >
> > 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 issue deprecation warning
> > first time and get rid of this interface after a couple
> > of releases.
> >
> > CC: Andrey Vagin <avagin@openvz.org>
> > CC: Andrew Morton <akpm@linuxfoundation.org>
> > CC: Pavel Emelyanov <xemul@virtuozzo.com>
> > CC: Michael Kerrisk <mtk.manpages@gmail.com>
> > CC: Yang Shi <yang.shi@linux.alibaba.com>
> > CC: Michal Hocko <mhocko@kernel.org>
> > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> > ---
> > Or we can simply drop it off because PR_SET_MM_MAP covers all needs,
> > and I would rather prefer to do that asap.
>
> Thanks for making it deprecated. I'd prefer just drop it off if nobody
> objects. The change will get soaked in linux-next for a while , we will know
> if it breaks compatibility (it sounds very unlikely).
Yeah, let's just drop it and have the patch in linux-next (via mmotm)
for 2 release cycles and see whether somebody complains.
You can add
Acked-by: Michal Hocko <mhocko@suse.com>
for such a patch.
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] prctl: Deprecate non PR_SET_MM_MAP operations
2018-04-04 5:35 ` Michal Hocko
@ 2018-04-04 6:59 ` Cyrill Gorcunov
2018-04-04 15:54 ` Yang Shi
1 sibling, 0 replies; 6+ messages in thread
From: Cyrill Gorcunov @ 2018-04-04 6:59 UTC (permalink / raw)
To: Michal Hocko
Cc: Yang Shi, LKML, Andrey Vagin, Andrew Morton, Pavel Emelyanov,
Michael Kerrisk
On Wed, Apr 04, 2018 at 07:35:41AM +0200, Michal Hocko wrote:
> > > Or we can simply drop it off because PR_SET_MM_MAP covers all needs,
> > > and I would rather prefer to do that asap.
> >
> > Thanks for making it deprecated. I'd prefer just drop it off if nobody
> > objects. The change will get soaked in linux-next for a while , we will know
> > if it breaks compatibility (it sounds very unlikely).
>
> Yeah, let's just drop it and have the patch in linux-next (via mmotm)
> for 2 release cycles and see whether somebody complains.
>
> You can add
> Acked-by: Michal Hocko <mhocko@suse.com>
> for such a patch.
Sure. Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] prctl: Deprecate non PR_SET_MM_MAP operations
2018-04-04 5:35 ` Michal Hocko
2018-04-04 6:59 ` Cyrill Gorcunov
@ 2018-04-04 15:54 ` Yang Shi
2018-04-04 15:58 ` Cyrill Gorcunov
1 sibling, 1 reply; 6+ messages in thread
From: Yang Shi @ 2018-04-04 15:54 UTC (permalink / raw)
To: Michal Hocko
Cc: Cyrill Gorcunov, LKML, Andrey Vagin, Andrew Morton,
Pavel Emelyanov, Michael Kerrisk
On 4/3/18 10:35 PM, Michal Hocko wrote:
> On Tue 03-04-18 16:15:20, Yang Shi wrote:
>>
>> On 4/3/18 3:37 PM, 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.
>>>
>>> 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 issue deprecation warning
>>> first time and get rid of this interface after a couple
>>> of releases.
>>>
>>> CC: Andrey Vagin <avagin@openvz.org>
>>> CC: Andrew Morton <akpm@linuxfoundation.org>
>>> CC: Pavel Emelyanov <xemul@virtuozzo.com>
>>> CC: Michael Kerrisk <mtk.manpages@gmail.com>
>>> CC: Yang Shi <yang.shi@linux.alibaba.com>
>>> CC: Michal Hocko <mhocko@kernel.org>
>>> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
>>> ---
>>> Or we can simply drop it off because PR_SET_MM_MAP covers all needs,
>>> and I would rather prefer to do that asap.
>> Thanks for making it deprecated. I'd prefer just drop it off if nobody
>> objects. The change will get soaked in linux-next for a while , we will know
>> if it breaks compatibility (it sounds very unlikely).
> Yeah, let's just drop it and have the patch in linux-next (via mmotm)
> for 2 release cycles and see whether somebody complains.
BTW, I will do my v3 on top of the patch (drop off prctl_set_mm).
Yang
>
> You can add
> Acked-by: Michal Hocko <mhocko@suse.com>
> for such a patch.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC] prctl: Deprecate non PR_SET_MM_MAP operations
2018-04-04 15:54 ` Yang Shi
@ 2018-04-04 15:58 ` Cyrill Gorcunov
0 siblings, 0 replies; 6+ messages in thread
From: Cyrill Gorcunov @ 2018-04-04 15:58 UTC (permalink / raw)
To: Yang Shi
Cc: Michal Hocko, LKML, Andrey Vagin, Andrew Morton, Pavel Emelyanov,
Michael Kerrisk
On Wed, Apr 04, 2018 at 08:54:59AM -0700, Yang Shi wrote:
> > Yeah, let's just drop it and have the patch in linux-next (via mmotm)
> > for 2 release cycles and see whether somebody complains.
>
> BTW, I will do my v3 on top of the patch (drop off prctl_set_mm).
Sorry for delay, will do in a couple of hours.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-04-04 15:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-03 22:37 [RFC] prctl: Deprecate non PR_SET_MM_MAP operations Cyrill Gorcunov
2018-04-03 23:15 ` Yang Shi
2018-04-04 5:35 ` Michal Hocko
2018-04-04 6:59 ` Cyrill Gorcunov
2018-04-04 15:54 ` Yang Shi
2018-04-04 15:58 ` Cyrill Gorcunov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).