public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* what's papered over by set_fs(USER_DS) in amd64 signal delivery?
@ 2010-09-24 15:52 Al Viro
  2010-09-24 16:07 ` Linus Torvalds
  0 siblings, 1 reply; 9+ messages in thread
From: Al Viro @ 2010-09-24 15:52 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: tglx, mingo, linux-kernel

	What the hell is going on in amd64 handle_signal()?  We do

#ifdef CONFIG_X86_64
        /*
         * This has nothing to do with segment registers,
         * despite the name.  This magic affects uaccess.h
         * macros' behavior.  Reset it to the normal setting.
         */
        set_fs(USER_DS);
#endif

in the end of sigframe creation; first of all, we'd just done a bunch of
copying to user-controlled addresses, protected only by access_ok(), so
if we *did* have something different we are already fucked badly.  Moreover,
if we had been on our way to userland (and we wouldn't have reached that
code otherwise) with wrong ->addr_limit and would *not* get a signal, we'd
be left with the same ->addr_limit for the next syscall to be done.  Fucked
again?

I've tried to find amd64-specific magic that would require that, but so far
I've found nothing of that kind.  It looks like until the i386/amd64 merge
*both* used to have that thing and during the merge it has suddenly grown
that ifdef, so another way to put it is "why the reasons allowing to kill
it on i386 do not apply to amd64?"

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-09-26  9:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24 15:52 what's papered over by set_fs(USER_DS) in amd64 signal delivery? Al Viro
2010-09-24 16:07 ` Linus Torvalds
2010-09-24 16:57   ` Al Viro
2010-09-25  2:25     ` Brian Gerst
2010-09-25  2:48       ` Al Viro
2010-09-25  3:51         ` Brian Gerst
2010-09-25  5:20           ` Al Viro
2010-09-25  9:54             ` Brian Gerst
2010-09-26  9:13             ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox