Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1362181

Re: Updated version of RD/WR FS/GS BASE patchkit

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: Updated version of RD/WR FS/GS BASE patchkit
Date 2016-03-21 23:30 +0100
Message-ID <rfguK-3zz-15@gated-at.bofh.it> (permalink)
References (2 earlier) <rfdGy-1FG-25@gated-at.bofh.it> <rfdGy-1FG-21@gated-at.bofh.it> <rfdZU-1O7-9@gated-at.bofh.it> <rfgbn-3qY-5@gated-at.bofh.it> <rfgl4-3uK-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Mar 21, 2016 at 3:11 PM, Andi Kleen <andi@firstfloor.org> wrote:
>> So a patchset to enable these asinine new instructions needs to take
>> this into account, and the ABI issue needs to be addressed, even if
>
> What's the ABI issue?
>
> AFAIK we're perfectly consistent.
>
>> the answer is that the proposed code is fine.
>>
>> (Also, the existing code is fscked up.  Guess what xor %eax, %eax; mov
>> %ax, %gs does to the base on AMD?  The existing code is *wrong*, and I
>> don't want to see it get wronger.)
>
> I have no idea, but changing it is definitely not in scope for my patches.
>
>>
>> And no, I don't really care about programs detecting context switches.
>> I do, however, care about allowing non-determinism in things that
>> ought to behave deterministically.  Writing a nonzero value to %gs and
>> then doing WRGSBASE is something that user code will be able to do
>> whether we like it or not, some shitty threading library is likely to
>> do this just to spite us, the the kernel needs to do *something* when
>> this happens.
>
> They will quickly notice it if there is a problem, so I don't think
> we need to worry about that.

Really?

Imagine that some brilliant lightweight threading library does:

 - set GS to nonzero (by whatever means -- arch_prctl(ARCH_SET_GS,
whatever) on a pre-IVB host followed by migration, some modify_ldt
garbage, simple bloody-mindedness, whatever);
 - WRGSBASE
 - Use GS for a bit

This will work most of the time until it gets unlucky with preemption.
And yes, runtime library authors really do mess up in amazing ways.

It's an issue.  It needs conscious design.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Updated version of RD/WR FS/GS BASE patchkit Andi Kleen <andi@firstfloor.org> - 2016-03-21 17:20 +0100
  Re: Updated version of RD/WR FS/GS BASE patchkit Andy Lutomirski <luto@amacapital.net> - 2016-03-21 20:30 +0100
    Re: Updated version of RD/WR FS/GS BASE patchkit Andi Kleen <andi@firstfloor.org> - 2016-03-21 20:50 +0100
      Re: Updated version of RD/WR FS/GS BASE patchkit Andy Lutomirski <luto@amacapital.net> - 2016-03-21 23:10 +0100
        Re: Updated version of RD/WR FS/GS BASE patchkit Andi Kleen <andi@firstfloor.org> - 2016-03-21 23:20 +0100
          Re: Updated version of RD/WR FS/GS BASE patchkit Andy Lutomirski <luto@amacapital.net> - 2016-03-21 23:30 +0100
            Re: Updated version of RD/WR FS/GS BASE patchkit Andi Kleen <andi@firstfloor.org> - 2016-03-21 23:50 +0100
              Re: Updated version of RD/WR FS/GS BASE patchkit Andy Lutomirski <luto@amacapital.net> - 2016-03-21 23:50 +0100
                Re: Updated version of RD/WR FS/GS BASE patchkit Andy Lutomirski <luto@amacapital.net> - 2016-03-22 00:00 +0100
                Re: Updated version of RD/WR FS/GS BASE patchkit Andi Kleen <andi@firstfloor.org> - 2016-03-22 00:10 +0100
                Re: Updated version of RD/WR FS/GS BASE patchkit Andi Kleen <andi@firstfloor.org> - 2016-03-22 00:00 +0100
  Re: Updated version of RD/WR FS/GS BASE patchkit Andi Kleen <andi@firstfloor.org> - 2016-03-21 20:30 +0100
  Re: Updated version of RD/WR FS/GS BASE patchkit Andy Lutomirski <luto@amacapital.net> - 2016-03-21 20:50 +0100

csiph-web