From: Ingo Molnar <mingo@elte.hu>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Alexander Viro <viro@ftp.linux.org.uk>,
Chris Wright <chrisw@sous-sol.org>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Bryan Donlan <bdonlan@gmail.com>, Avi Kivity <avi@redhat.com>,
Christopher Yeoh <cyeoh@au1.ibm.com>,
linux-kernel@vger.kernel.org,
Linux Memory Management List <linux-mm@kvack.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC][PATCH] Cross Memory Attach
Date: Thu, 16 Sep 2010 10:08:26 +0200 [thread overview]
Message-ID: <20100916080826.GB21228@elte.hu> (raw)
In-Reply-To: <20100916105311.CA00.A69D9226@jp.fujitsu.com>
* KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> wrote:
> > On Wed, Sep 15, 2010 at 19:58, Avi Kivity <avi@redhat.com> wrote:
> >
> > > Instead of those two syscalls, how about a vmfd(pid_t pid, ulong start,
> > > ulong len) system call which returns an file descriptor that represents a
> > > portion of the process address space. You can then use preadv() and
> > > pwritev() to copy memory, and io_submit(IO_CMD_PREADV) and
> > > io_submit(IO_CMD_PWRITEV) for asynchronous variants (especially useful with
> > > a dma engine, since that adds latency).
> > >
> > > With some care (and use of mmu_notifiers) you can even mmap() your vmfd and
> > > access remote process memory directly.
> >
> > Rather than introducing a new vmfd() API for this, why not just add
> > implementations for these more efficient operations to the existing
> > /proc/$pid/mem interface?
>
> As far as I heared from my friend, old HP MPI implementation used
> /proc/$pid/mem for this purpose. (I don't know current status).
> However almost implementation doesn't do that because /proc/$pid/mem
> required the process is ptraced. As far as I understand , very old
> /proc/$pid/mem doesn't require it. but It changed for security
> concern. Then, Anybody haven't want to change this interface because
> they worry break security.
>
> But, I don't know what exactly protected "the process is ptraced"
> check. If anyone explain the reason and we can remove it. I'm not
> againt at all.
I did some Git digging - that ptrace check for /proc/$pid/mem read/write
goes all the way back to the beginning of written human history, aka
Linux v2.6.12-rc2.
I researched the fragmented history of the stone ages as well, i checked
out numerous cave paintings, and while much was lost, i was able to
recover this old fragment of a clue in the cave called 'patch-2.3.27',
carbon-dated back as far as the previous millenium (!):
mem_read() in fs/proc/base.c:
+ * 1999, Al Viro. Rewritten. Now it covers the whole per-process part.
+ * Instead of using magical inumbers to determine the kind of object
+ * we allocate and fill in-core inodes upon lookup. They don't even
+ * go into icache. We cache the reference to task_struct upon lookup too.
+ * Eventually it should become a filesystem in its own. We don't use the
+ * rest of procfs anymore.
In such a long timespan language has changed much, so not all of this
scribbling can be interpreted - but one thing appears to be sure: this
is where the MAY_PTRACE() restriction was introduced to /proc/$pid/mem -
as part of a massive rewrite.
Alas, the reason for the restriction was not documented, and is feared
to be lost forever.
Thanks,
Ingo
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2010-09-16 8:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20100915104855.41de3ebf@lilo>
2010-09-15 8:02 ` Ingo Molnar
2010-09-15 8:16 ` Ingo Molnar
2010-09-15 13:23 ` Christopher Yeoh
2010-09-15 13:20 ` Christopher Yeoh
2010-09-15 10:58 ` Avi Kivity
2010-09-15 13:51 ` Ingo Molnar
2010-09-15 16:10 ` Avi Kivity
2010-09-15 14:42 ` Christopher Yeoh
2010-09-15 14:52 ` Linus Torvalds
2010-09-15 15:44 ` Robin Holt
2010-09-16 6:32 ` Brice Goglin
2010-09-16 9:15 ` Brice Goglin
2010-09-16 14:00 ` Christopher Yeoh
2010-09-15 14:46 ` Bryan Donlan
2010-09-15 16:13 ` Avi Kivity
2010-09-15 19:35 ` Eric W. Biederman
2010-09-16 1:18 ` Christopher Yeoh
2010-09-16 9:26 ` Avi Kivity
2010-11-02 3:37 ` Christopher Yeoh
2010-11-02 11:10 ` Avi Kivity
2010-09-16 1:58 ` KOSAKI Motohiro
2010-09-16 8:08 ` Ingo Molnar [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=20100916080826.GB21228@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=avi@redhat.com \
--cc=bdonlan@gmail.com \
--cc=chrisw@sous-sol.org \
--cc=cyeoh@au1.ibm.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@ftp.linux.org.uk \
/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