From: Al Viro <viro@ZenIV.linux.org.uk>
To: Michel Lespinasse <walken@google.com>
Cc: linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
Hugh Dickins <hughd@google.com>
Subject: Re: Issues with "x86, um: switch to generic fork/vfork/clone" commit
Date: Sat, 10 Nov 2012 18:59:03 +0000 [thread overview]
Message-ID: <20121110185903.GQ2616@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20121110073338.GP2616@ZenIV.linux.org.uk>
On Sat, Nov 10, 2012 at 07:33:39AM +0000, Al Viro wrote:
> I think I see what's going on there. It's PTREGSCALL blindly used for
> clone wrapper in ia32entry.S. FWIW, it's wrong for all of those
> suckers, anyway:
> * fork/clone/vfork need to save extra registers, but don't need
> to restore them; after unification we don't need pt_regs argument for any
> of those - for fork/vfork it's useless, for clone it breaks things.
> * execve doesn't need pt_regs argument; harmless, but useless.
> * for sigaltstack() we simply need to get rid of stupid pt_regs
> argument, along with the wrapper; current_pt_regs()->sp is all it needs.
> * for sigreturn/rt_sigreturn we need to restore extra registers,
> but we do *not* need to save them; just leave the space on stack. And
> no need to pass pt_regs either - it'll be current_pt_regs() anyway.
> * iopl() doesn't need to save/restore extras and it doesn't need
> pt_regs argument - it's going to be current_pt_regs().
Alas, sigaltack() and iopl() do need a bit of a wrapper; they don't care
about extras, but they wants ->sp and ->flags resp., which means needing
to go through FIXUP_TOP_OF_STACK on amd64 ;-/
> On top of all that, there's an extra piece of crap - different order of
> arguments for native and compat clone.
... and the same commit slightly buggers clone(2) on amd64 as well. Grr...
Anyway, fixed and pushed; please, test for-next when it propagates, head
should be at fae45353de587ae6a949dbf21ee06d5dd652248c
next prev parent reply other threads:[~2012-11-10 18:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-10 4:36 Issues with "x86, um: switch to generic fork/vfork/clone" commit Michel Lespinasse
2012-11-10 4:51 ` Al Viro
2012-11-10 4:57 ` Michel Lespinasse
2012-11-10 5:33 ` Al Viro
2012-11-10 5:47 ` Michel Lespinasse
2012-11-10 7:33 ` Al Viro
2012-11-10 8:08 ` Michel Lespinasse
2012-11-10 18:59 ` Al Viro [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-01-14 9:42 Nicolas Dichtel
2013-01-19 6:38 ` Al Viro
2013-01-20 3:12 ` Al Viro
2013-01-20 20:53 ` Linus Torvalds
2013-01-20 21:28 ` Al Viro
2013-01-21 1:22 ` Al Viro
2013-01-21 1:40 ` Linus Torvalds
2013-01-21 2:30 ` Al Viro
2013-01-21 2:39 ` Linus Torvalds
2013-01-21 6:02 ` Al Viro
2013-01-21 9:00 ` Nicolas Dichtel
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=20121110185903.GQ2616@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=walken@google.com \
/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