lkml.org 
[lkml]   [2010]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: what's papered over by set_fs(USER_DS) in amd64 signal delivery?
On Fri, Sep 24, 2010 at 8:52 AM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>        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

I _think_ it is historical, and probably relates to just restoring all
the user mode state at signal delivery to a known state. IOW, I think
it really does go hand-in-hand with the whole "clear bits in the
eflags register" thing.

x86-64 has historically had some left-over crap that we already
cleaned up in 32-bit mode, for the simple reason that the original
x86-64 code was forked from an earlier base, and then hacked up
somewhat. So I think this "#ifdef CONFIG_X86_64" is just a case of
that.

But maybe we should have a WARN_ON_ONCE() to verify it, rather than
just kill it outright.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-09-27 20:09    [W:0.133 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site