Re: [RFC][PATCHSET] mremap/mmap mess

From: Peter Zijlstra
Date: Wed Dec 09 2009 - 07:22:13 EST


On Wed, 2009-12-09 at 11:43 +0000, Hugh Dickins wrote:

> On Tue, 8 Dec 2009, Al Viro wrote:
> > On Tue, Dec 08, 2009 at 01:08:02PM -0800, David Miller wrote:
> > > From: Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx>
> > > Date: Tue, 8 Dec 2009 13:03:30 +0000 (GMT)

> Would it make sense to build up argv and env of execee on the execer's
> user stack (below user's sp ("below" assuming topdown stack))?

> > >
> > > > That would impose some (unacceptable?) limits, and require some funny
> > > > code to migrate the pages over to the new mm later (instead of
> > > > relocating within the new mm as we do now).
> > >
> > > I think this approach would create new failure cases that don't exist
> > > now. Whether that's acceptable or not is another issue.
>
> David: Yes, that's one of my fears too - I don't think
> rlimits would pose any new problem, but building up the argv+env below
> sp on the execer's userstack would be in danger of colliding with the
> vma below if the space allowed to that userstack is too small. We can
> say "sorry, you left too little space for your userstack", but it's
> still a regression. My other big fear is this: that it's such a simple
> and obvious way to do it, that it has probably been ruled out for very
> good reasons in the past.

Vague memories, but here goes..

/me ponders.. doesn't the binfmt engine cruft need the args in place in
order to execute?

That is, IIRC the problem is that you need to have the argc/env in place
for the binfmt engine thing, and need to have ran the binfmt engine
thing before you know the personality.

As to your idea, if that were feasible we could do without the copy and
simply steal the pages directly from the old mm.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/