Menu

#2431 Asm/arm64/LzmaDecOpt.S does not support PAC and BTI

open
nobody
None
5
2024-07-05
2023-11-30
No

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

The following warning message shows the issue:

[   56s] /usr/lib64/gcc/aarch64-suse-linux/13/../../../../aarch64-suse-linux/bin/ld: b/g_arm64/LzmaDecOpt.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

Discussion

  • Igor Pavlov

    Igor Pavlov - 2023-12-04

    I don't have any warnings in my test.
    What exact compilers and commands/switches do you use?

     
    • Guillaume GARDET

      You can use GCC13 with -mbranch-protection=standard as LOCAL_FLAGS and also add -z force-bti as LDFLAGS to actually show the warning.

       
  • Igor Pavlov

    Igor Pavlov - 2023-12-04

    gcc (Debian 13.2.0-4) 13.2.0 gives warnings for some gcc files too:

    /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/Scrt1.o: warning: BTI turned on by -z force-bti when all inputs do not have BTI in NOTE section.
    
     
  • Bill Roberts

    Bill Roberts - 2024-07-05
     

Log in to post a comment.