[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Update x86 psABI to support shadow stac



On Fri, Jul 28, 2017 at 7:59 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 07/27/2017 06:21 PM, H.J. Lu wrote:
>> On Thu, Jul 27, 2017 at 8:44 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>> On 06/28/2017 01:21 PM, H.J. Lu wrote:
>>>> On Wed, Jun 28, 2017 at 2:58 AM, Florian Weimer <fweimer@redhat.com> wrote:
>>>>> On 06/22/2017 08:44 PM, H.J. Lu wrote:
>>>>>>> The responsibilities for compliance are split between caller and callee,
>>>>>>> which can live in different shared objects.  I think it would be prudent
>>>>>>> to formulate the requirement in such a way that compliance can be
>>>>>>> checked by looking at one DSO in isolation.
>>>>>
>>>>>> What do you mean by it?
>>>>>
>>>>> I suggest to word the ABI requirement in such a way that it is possible
>>>>> to verify if a shared object complies with it isolation, independent of
>>>>> how its functions are called.
>>>>>
>>>>
>>>> 99% of existing binaries are compatible with shadow stack.
>>>
>>> I find that surprising, or does this number to refer to x86-64 binaries
>>> only?
>>
>> CET is x86 specific.  You can take a look at the current CET changes for
>> GCC at
>>
>> https://github.com/hjl-tools/gcc/tree/hjl/cet/reorg16
>
> So i386 is supported?  Then I find your claim about 99% compatibility

Yes, i386 is supported.

> surprising because LLVM uses this instruction sequence
>
>         calll   .L0$pb
> .L0$pb:
>         popl    %ebx
> .Ltmp0:
>         addl    $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %ebx
>
> to set %ebx to the GOT pointer.
>

This is called "call 0" and it won't push on shadow stack.  CET
document will be updated to reflect it.


-- 
H.J.