[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0912061000090.3560@localhost.localdomain>
Date: Sun, 6 Dec 2009 10:00:24 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Hugh Dickins <hugh.dickins@...cali.co.uk>
cc: Al Viro <viro@....linux.org.uk>, linux-arch@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCHSET] mremap/mmap mess
On Sun, 6 Dec 2009, Hugh Dickins wrote:
>
> I've never found out why we need access_process_vm() to expand a stack:
> shall we see what breaks if we just forbid expand_stack() on another mm?
Hmm. If you want to actually emulate some stack instruction using ptrace,
you'd need to be able to extend the stack.
The classic example of this might be to do some crazy user-space emulation
of 'pushf' for virtualization.
And emulating pushf is not theory: at least KVM does actually do exactly
that (although KVM obviously does it from kernel space and from within the
process that faulted). Same goes for vm86 mode (again, we do that
emulation in kernel) and for ptrace single-stepping (which we actually
don't bother emulating).
The point being that at least 'pushf' really _is_ an instruction that (a)
might want to extend the stack and (b) does tend to need emulation or
fixup in some virtualized/emulated environments. I just don't know if you
actually ever have user space doing so.
But I could imagine that Wine does some pushf emulation using ptrace, for
example.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists