lkml.org 
[lkml]   [2014]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [CRIU] [PATCH 1/3] prctl: reduce permissions to change boundaries of data, brk and stack
On Fri, Feb 14, 2014 at 12:18:46PM -0800, Eric W. Biederman wrote:
> >> >
> >> > Why can't you have the process of interest do:
> >> > ptrace(PTRACE_ATTACHME);
> >> > execve(executable, args, ...);
> >> >
> >> > /* Have the ptracer inject the recovery/fixup code */
> >> > /* Fix up the mostly correct process to look like it has been
> >> > * executing for a while.
> >> > */
> >
> > Erik, it seems I don't understand how it will help us to restore
> > the mm fields mentioned above?
>
> Because exec is how those mm fields are set when you don't use
> prctl_set_mm. So execpt for the stack and the brk limits that
> will simply result in the values being set to what the usually
> would be set to.

Yes, all these fields are set up by kernel's elf loader but this
routine is a way more time consuming than a clone call. But gimme
some time to examine all possible problems we might have with such
approach and if there a way to solve them.

> >> Let's imagine we do that.
> >>
> >> This means, that the whole memory contents should be restored _after_
> >> the execve() call, since the execve() flushes old mappings. In
> >> that case we lose the ability to preserve any shared memory regions
> >> between any two processes. This "shared" can be either regular
> >> MAP_SHARED mappings or MAP_ANONYMOUS but still not COW-ed ones.


\
 
 \ /
  Last update: 2014-02-15 08:21    [W:1.785 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site