gcc/libitm
Szabolcs Nagy ab240ab509 aarch64: add PAC-RET protection to libitm sjlj.S
_ITM_beginTransaction is a 'returns_twice' function that saves x30
on the stack as part of gtm_jmpbuf (that is passed down to
GTM_begin_transaction), but the saved x30 is also used for return.

The return path should be protected so we don't leave an
  ldp x29, x30, [sp]
  ret
gadget in the code, so x30 is signed on function entry. This
exposes the signed address in the gtm_jmpbuf too. The jmpbuf does
not need a signed address since GTM_longjmp uses
  ldp x29, x30, [x1]
  br x30
and with BTI there is a BTI j at the _ITM_beginTransaction call site
where this jump returns. Using PAC does not hurt: the gtm_jmpbuf is
internal to libitm and its layout is only used by sjlj.S so the
signed address does not escape. Saving signed x30 into gtm_jmpbuf
provides a bit of extra protection, but more importantly it allows
adding the PAC-RET support without changing the existing code much.

In theory bti and pac-ret protection can be added unconditionally
since the instructions are in the nop space, in practice they
can cause trouble if some tooling does not understand the gnu
property note (e.g. old binutils) or some unwinder or debugger
does not understand the new dwarf op code used for pac-ret (e.g
old gdb). So the code is written to only support branch-protection
according to the code generation options.

libitm/ChangeLog:

	* config/aarch64/sjlj.S: Add conditional pac-ret protection.
2020-07-24 11:44:53 +01:00
..
config aarch64: add PAC-RET protection to libitm sjlj.S 2020-07-24 11:44:53 +01:00
testsuite libitm: Disable diagnostic coloring in tests 2020-05-05 12:50:54 -07:00
aatree.cc Update copyright years. 2020-01-01 12:51:42 +01:00
aatree.h Update copyright years. 2020-01-01 12:51:42 +01:00
acinclude.m4 re PR other/79543 (Inappropriate "ld --version" checking) 2019-09-03 14:10:26 +00:00
aclocal.m4 Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
alloc_c.cc Update copyright years. 2020-01-01 12:51:42 +01:00
alloc_cpp.cc Update copyright years. 2020-01-01 12:51:42 +01:00
alloc.cc Update copyright years. 2020-01-01 12:51:42 +01:00
barrier.cc Update copyright years. 2020-01-01 12:51:42 +01:00
beginend.cc Update copyright years. 2020-01-01 12:51:42 +01:00
ChangeLog Daily bump. 2020-07-10 00:16:28 +00:00
clone.cc Update copyright years. 2020-01-01 12:51:42 +01:00
common.h Update copyright years. 2020-01-01 12:51:42 +01:00
config.h.in
configure Avoid nested save_CFLAGS and save_LDFLAGS 2020-05-29 12:56:40 -07:00
configure.ac Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
configure.tgt Update copyright years. 2020-01-01 12:51:42 +01:00
containers.h Update copyright years. 2020-01-01 12:51:42 +01:00
dispatch.h Update copyright years. 2020-01-01 12:51:42 +01:00
eh_cpp.cc Fix throw specifiers on interface. 2020-05-12 10:54:53 -07:00
libitm_i.h Update copyright years. 2020-01-01 12:51:42 +01:00
libitm.h Fix throw specifiers on interface. 2020-05-12 10:54:53 -07:00
libitm.map
libitm.spec.in
libitm.texi gcc.c (process_command): Update copyright notice dates. 2020-01-01 12:14:37 +01:00
local_atomic Update copyright years. 2020-01-01 12:51:42 +01:00
local.cc Update copyright years. 2020-01-01 12:51:42 +01:00
Makefile.am
Makefile.in Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
method-gl.cc Update copyright years. 2020-01-01 12:51:42 +01:00
method-ml.cc Update copyright years. 2020-01-01 12:51:42 +01:00
method-serial.cc Update copyright years. 2020-01-01 12:51:42 +01:00
query.cc Update copyright years. 2020-01-01 12:51:42 +01:00
retry.cc Update copyright years. 2020-01-01 12:51:42 +01:00
useraction.cc Update copyright years. 2020-01-01 12:51:42 +01:00
util.cc Update copyright years. 2020-01-01 12:51:42 +01:00