public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.COM>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrey Vagin <avagin@openvz.org>,
	Andrew Morton <akpm@linuxfoundation.org>,
	Pavel Emelyanov <xemul@virtuozzo.com>,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Yang Shi <yang.shi@linux.alibaba.com>,
	Michal Hocko <mhocko@kernel.org>
Subject: Re: [RFC] prctl: (Please do not!) Deprecate non PR_SET_MM_MAP operations
Date: Sun, 6 May 2018 19:44:57 +0300	[thread overview]
Message-ID: <20180506164457.GP31735@uranus> (raw)
In-Reply-To: <c8d4aa19-1bb4-3f72-4600-8d20fdad98d9@NTLWorld.COM>

On Sun, May 06, 2018 at 12:01:44PM +0100, Jonathan de Boyne Pollard wrote:
> Cyrill Gorcunov:
> 
> > Or we can simply drop it off because PR_SET_MM_MAP covers all needs, and I
> would rather prefer to do that asap.
> 
> Please do not do that, because PR_SET_MM_MAP really does not cover all
> needs.  Not by a long shot.
> 
> The use case is applications that want to affect /proc/self/cmdline and
> /proc/self/environ on the fly, for controlling what is displayed in a ps
> listing, but do not have to hand or want to deal in any of the *other*
> information that PR_SET_MM_MAP mandates.  They just want the pseudo-files to
> point to a new chunk of memory that they have allocated from their heaps and
> filled in.  They don't want to have to deal in all of the otherwise
> irrelevant stuff, of how they are loaded into memory and open file
> descriptors for executables.
> 
> * https://unix.stackexchange.com/a/438007/5132
> 
> * https://unix.stackexchange.com/a/432681/5132
> 
> You have not provided a way to read out that information, which would at
> least make a query-modify-set approach viable for such applications.  So
> please do not remove the API that works and that is in use without providing
> a usable substitute that is at least as good, which what you are proposing
> is not.  Ironically, if you replaced what you want to replace by going back
> to the original design of having start+length passed in one atomic ioctl()
> call, rather than two separate ioctl() calls for setting start and end
> individually (and the consequent hoops that applications softwares have to
> jump through when modifying to new pointer pairs, and seemingly unavoidable
> windows for outright data leaks, because they cannot read out the existing
> values and cannot even temporarily set start > end), that would be a welcome
> improvement.
> 
> Incidentally, it is a welcome change to see the idea that unprivileged
> processes may alter these things being introduced, as is already the case on
> (say) FreeBSD.
> 
> (I am not subscribed to linux-kernel.)

So eventually people use this feature outside of criu. Moreover I found that
systemd calls for PR_SET_MM_ARG_START/END (hell knows how I managed to miss
it when beeing googling for constants trying to find a user for this interface).

That said, indeed, we can't just drop it away while here are users. I'm
working on patches to bring back compat layer with the former interface.

Thanks a huge for reporting!

	Cyrill

      parent reply	other threads:[~2018-05-06 16:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c8d4aa19-1bb4-3f72-4600-8d20fdad98d9@NTLWorld.COM>
2018-05-06 12:52 ` [RFC] prctl: (Please do not!) Deprecate non PR_SET_MM_MAP operations Cyrill Gorcunov
2018-05-06 16:44 ` Cyrill Gorcunov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180506164457.GP31735@uranus \
    --to=gorcunov@gmail.com \
    --cc=J.deBoynePollard-newsgroups@NTLWorld.COM \
    --cc=akpm@linuxfoundation.org \
    --cc=avagin@openvz.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=xemul@virtuozzo.com \
    --cc=yang.shi@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox