public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Al Viro <viro@ftp.linux.org.uk>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCHSET] mremap/mmap mess
Date: Sun, 6 Dec 2009 10:00:24 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0912061000090.3560@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.64.0912061715280.3721@sister.anvils>


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

  reply	other threads:[~2009-12-06 18:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-05 19:08 [RFC][PATCHSET] mremap/mmap mess Al Viro
2009-12-05 19:08 ` Al Viro
2009-12-05 20:44 ` Linus Torvalds
2009-12-05 23:01 ` Al Viro
2009-12-05 23:58 ` Russell King
2009-12-06 17:22 ` Hugh Dickins
2009-12-06 18:00   ` Linus Torvalds [this message]
2009-12-07  3:58 ` Al Viro
2009-12-07 18:58   ` Hugh Dickins
2009-12-07 18:58     ` Hugh Dickins
2009-12-07 19:30     ` Al Viro
2009-12-07 20:05       ` Hugh Dickins
2009-12-07 20:05         ` Hugh Dickins
2009-12-08  6:07         ` Al Viro
2009-12-08 11:42           ` Hugh Dickins
2009-12-08 13:03             ` Hugh Dickins
2009-12-08 21:08               ` David Miller
2009-12-08 22:06                 ` Al Viro
2009-12-09 11:43                   ` Hugh Dickins
2009-12-09 12:21                     ` Peter Zijlstra
2009-12-09 12:21                       ` Peter Zijlstra
2009-12-09 13:12                       ` Hugh Dickins
2009-12-09 13:37                         ` Peter Zijlstra
2009-12-09 13:24                       ` Al Viro
2009-12-09 13:39                         ` Peter Zijlstra
2009-12-09 13:46                     ` Al Viro
2009-12-09 14:36                       ` Hugh Dickins
2009-12-09 15:12                     ` Linus Torvalds

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=alpine.LFD.2.00.0912061000090.3560@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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