[PATCH 02/12] x86-64: Add endbr64 to tst-quadmod[12].S

Carlos O'Donell carlos@redhat.com
Tue Jul 24 12:27:00 GMT 2018


On 07/24/2018 07:58 AM, H.J. Lu wrote:
> On Mon, Jul 23, 2018 at 7:53 PM, Carlos O'Donell <carlos@redhat.com> wrote:
>> On 07/21/2018 10:20 AM, H.J. Lu wrote:
>>> Add endbr64 to tst-quadmod1.S and tst-quadmod2.S so that func and foo
>>> can be called indirectly.
>>>
>>>       * sysdeps/x86_64/tst-quadmod1.S (func): Add endbr64 if IBT is
>>>       enabled.
>>>       (foo): Likewise.
>>>       * sysdeps/x86_64/tst-quadmod2.S (func) : Likewise.
>>>       (foo): Likewise.
>>> ---
>>>  sysdeps/x86_64/tst-quadmod1.S | 6 ++++++
>>>  sysdeps/x86_64/tst-quadmod2.S | 6 ++++++
>>>  2 files changed, 12 insertions(+)
>>
>> This is OK as-is, but marking foo with enbr64 seems
>> beyond what is needed. Only foo calls func directly,
> 
> Both func and foo needs ENDBR64.   All global functions
> may be called indirectly via PLT:

Sorry, you are correct. I wasn't thinking about the fact that the
main program calls via the PLT and we need an ENBR to continue the
CET state machine or the process will be terminated.

Cheers,
Carlos.



More information about the Libc-alpha mailing list