Vulkan-Loader icon indicating copy to clipboard operation
Vulkan-Loader copied to clipboard

`unknown_ext_chain_gas_aarch64.S` does not support PAC/BTI

Open ggardet opened this issue 1 year ago • 1 comments

Describe the bug On aarch64/arm64, when we build with -mbranch-protection=standard to enable Pointer Authentication (PAC) and Branch Target Identification (BTI), the final link disable them, because unknown_ext_chain_gas_aarch64.S does not support PAC and BTI.

The following warning message shows the issue:

[   22s] /usr/lib64/gcc/aarch64-suse-linux/13/../../../../aarch64-suse-linux/bin/ld: CMakeFiles/vulkan.dir/unknown_ext_chain_gas_aarch64.S.o: warning: BTI turned on by -z force-bti when all inputs do not have BTI in NOTE section.

This is a matter to add paciasp/autiasp in start/end of functions for PAC and BTI C (or hint #34) as landing pad on branches for BTI.

More information on :

  • PAC: https://developer.arm.com/documentation/102433/0100/Return-oriented-programming
  • BTI: https://developer.arm.com/documentation/102433/0100/Jump-oriented-programming

Environment (please complete the following information):

  • OS: openSUSE Tumbleweed aarch64
  • Bitdepth: 64-bit
  • GPU: N/A
  • Graphics Driver: N/A
  • SDK or header version if building from repo: N/A
  • Enabled layers: N/A

To Reproduce Steps to reproduce the behavior:

  1. Build with -mbranch-protection=standard and add -z force-bti to LD_FLAGS
  2. See the warning message above

VK_LOADER_DEBUG output N/A

Additional context

ggardet avatar Nov 30 '23 13:11 ggardet