Index: compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S =================================================================== --- compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S +++ compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S @@ -35,6 +35,7 @@ ASM_TYPE_FUNCTION(__interceptor_setjmp) __interceptor_setjmp: CFI_STARTPROC + _CET_ENDBR xorl %esi, %esi jmp __interceptor_sigsetjmp CFI_ENDPROC @@ -44,6 +45,7 @@ ASM_TYPE_FUNCTION(__interceptor_sigsetjmp) __interceptor_sigsetjmp: CFI_STARTPROC + _CET_ENDBR // Save callee save registers. mov %rbx, (0*8)(%rdi) Index: compiler-rt/lib/sanitizer_common/sanitizer_asm.h =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_asm.h +++ compiler-rt/lib/sanitizer_common/sanitizer_asm.h @@ -66,3 +66,7 @@ #else #define NO_EXEC_STACK_DIRECTIVE #endif + +#if defined(__x86_64__) || defined(__i386__) +#include +#endif Index: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S +++ compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S @@ -6,6 +6,7 @@ .globl ASM_WRAPPER_NAME(vfork) ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork)) ASM_WRAPPER_NAME(vfork): + _CET_ENDBR // Store return address in the spill area and tear down the stack frame. sub $12, %esp call COMMON_INTERCEPTOR_SPILL_AREA Index: compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S =================================================================== --- compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S +++ compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S @@ -6,6 +6,7 @@ .globl ASM_WRAPPER_NAME(vfork) ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork)) ASM_WRAPPER_NAME(vfork): + _CET_ENDBR // Store return address in the spill area and tear down the stack frame. push %rcx call COMMON_INTERCEPTOR_SPILL_AREA Index: compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S =================================================================== --- compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S +++ compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S @@ -13,6 +13,7 @@ .globl ASM_SYMBOL(__tsan_trace_switch_thunk) ASM_SYMBOL(__tsan_trace_switch_thunk): CFI_STARTPROC + _CET_ENDBR # Save scratch registers. push %rax CFI_ADJUST_CFA_OFFSET(8) @@ -93,6 +94,7 @@ .globl ASM_SYMBOL(__tsan_report_race_thunk) ASM_SYMBOL(__tsan_report_race_thunk): CFI_STARTPROC + _CET_ENDBR # Save scratch registers. push %rax CFI_ADJUST_CFA_OFFSET(8) @@ -185,6 +187,7 @@ ASM_SYMBOL_INTERCEPTOR(setjmp): #endif CFI_STARTPROC + _CET_ENDBR // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8) @@ -226,6 +229,7 @@ ASM_TYPE_FUNCTION(ASM_SYMBOL_INTERCEPTOR(_setjmp)) ASM_SYMBOL_INTERCEPTOR(_setjmp): CFI_STARTPROC + _CET_ENDBR // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8) @@ -267,6 +271,7 @@ ASM_SYMBOL_INTERCEPTOR(sigsetjmp): #endif CFI_STARTPROC + _CET_ENDBR // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8) @@ -323,6 +328,7 @@ ASM_TYPE_FUNCTION(ASM_SYMBOL_INTERCEPTOR(__sigsetjmp)) ASM_SYMBOL_INTERCEPTOR(__sigsetjmp): CFI_STARTPROC + _CET_ENDBR // save env parameter push %rdi CFI_ADJUST_CFA_OFFSET(8)