[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100924155231.GQ19804@ZenIV.linux.org.uk>
Date: Fri, 24 Sep 2010 16:52:31 +0100
From: Al Viro <viro@...IV.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: tglx@...utronix.de, mingo@...hat.com, linux-kernel@...r.kernel.org
Subject: what's papered over by set_fs(USER_DS) in amd64 signal delivery?
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?"
--
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