i386: Add _CET_ENDBR to indirect jump targets

Authored by H.J. Lu <hjl.tools@gmail.com> on Jan 19 2020, 3:40 PM.

Description

i386: Add _CET_ENDBR to indirect jump targets

* mpi/i386/mpih-add1.S (_gcry_mpih_add_n): Save and restore
%ebx if IBT is enabed.  Add _CET_ENDBR to indirect jump targets
and adjust jump destination for _CET_ENDBR.
* mpi/i386/mpih-sub1.S (_gcry_mpih_sub_n): Likewise.

i386 mpih-add1.S and mpih-sub1.S use a trick to implment jump tables
with LEA. We can't use conditional branches nor normal jump tables
since jump table entries use EFLAGS set by jump table index. This
patch adds _CET_ENDBR to indirect jump targets and adjust destination
for _CET_ENDBR.

  • Signed-off-by: H.J. Lu <hjl.tools@gmail.com>

Details

Committed
jukiviliWed, Jan 22, 8:55 PM
Parents
rC22e577071790: amd64: Always include <config.h> in cipher assembly codes
Branches
Unknown
Tags
Unknown