[lkml]   [2009]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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


 \ /
  Last update: 2009-12-06 19:03    [W:0.088 / U:6.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site