Skip to content

[BOLT] pacret-scanner: fix regression tests... #128565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

kbeyls
Copy link
Collaborator

@kbeyls kbeyls commented Feb 24, 2025

by making the regex to match basic block names more general. See failing test case that was reported on some system in comment #122304 (comment)

These test cases were introduced in PR #122304, commit 850b492 .

by making the regex to match basic block names more general.
See failing test case that was reported on some system in comment
llvm#122304 (comment)

These test cases were introduced in PR llvm#122304, commit 850b492.
@llvmbot
Copy link
Member

llvmbot commented Feb 24, 2025

@llvm/pr-subscribers-bolt

Author: Kristof Beyls (kbeyls)

Changes

by making the regex to match basic block names more general. See failing test case that was reported on some system in comment #122304 (comment)

These test cases were introduced in PR #122304, commit 850b492 .


Full diff: https://github.com/llvm/llvm-project/pull/128565.diff

2 Files Affected:

  • (modified) bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s (+22-22)
  • (modified) bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s (+2-2)
diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
index cc2fe96d00496..92aca0efd4418 100644
--- a/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
+++ b/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
@@ -13,7 +13,7 @@ f1:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         // autiasp
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f1, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f1, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -66,7 +66,7 @@ f_intermediate_overwrite2:
         ldp     x29, x30, [sp], #16
         autiasp
         mov     x30, x0
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite2, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite2, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: mov     x30, x0
@@ -109,7 +109,7 @@ f_intermediate_overwrite3:
         ldp     x29, x30, [sp], #16
         autiasp
         mov     w30, w0
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite3, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite3, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: mov     w30, w0
@@ -137,7 +137,7 @@ f_nonx30_ret:
         ldp     x29, x30, [sp], #16
         mov     x16, x30
         autiasp
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_nonx30_ret, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_nonx30_ret, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret     x16
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: mov     x16, x30
@@ -222,7 +222,7 @@ f_nonx30_ret_non_auted:
         .type   f_callclobbered_x30,@function
 f_callclobbered_x30:
         bl      g
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_x30, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_x30, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: bl      g@PLT
@@ -236,7 +236,7 @@ f_callclobbered_x30:
         .type   f_callclobbered_calleesaved,@function
 f_callclobbered_calleesaved:
         bl      g
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_calleesaved, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_calleesaved, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret x19
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: bl      g@PLT
@@ -325,7 +325,7 @@ f_autia1716:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autia1716
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia1716, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia1716, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -351,7 +351,7 @@ f_autib1716:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autib1716
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib1716, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib1716, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -377,7 +377,7 @@ f_autiax12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autia   x12, sp
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autiax12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autiax12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -403,7 +403,7 @@ f_autibx12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autib   x12, sp
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autibx12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autibx12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -458,7 +458,7 @@ f_autdax12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autda   x12, sp
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdax12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdax12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -484,7 +484,7 @@ f_autdbx12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autdb   x12, sp
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdbx12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdbx12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -539,7 +539,7 @@ f_autizax12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autiza  x12
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizax12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizax12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -565,7 +565,7 @@ f_autizbx12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autizb  x12
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizbx12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizbx12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -620,7 +620,7 @@ f_autdzax12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autdza  x12
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzax12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzax12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -646,7 +646,7 @@ f_autdzbx12:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autdzb  x12
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzbx12, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzbx12, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -725,7 +725,7 @@ f_eretaa:
         bl      g
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
-// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretaa, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretaa, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:   The return instruction is     {{[0-9a-f]+}}:       eretaa
         eretaa
         .size f_eretaa, .-f_eretaa
@@ -739,7 +739,7 @@ f_eretab:
         bl      g
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
-// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretab, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretab, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:   The return instruction is     {{[0-9a-f]+}}:       eretab
         eretab
         .size f_eretab, .-f_eretab
@@ -753,7 +753,7 @@ f_eret:
         bl      g
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
-// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eret, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eret, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:   The return instruction is     {{[0-9a-f]+}}:       eret
         eret
         .size f_eret, .-f_eret
@@ -761,7 +761,7 @@ f_eret:
         .globl f_movx30reg
         .type   f_movx30reg,@function
 f_movx30reg:
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_movx30reg, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_movx30reg, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: mov x30, x22
@@ -908,7 +908,7 @@ f_autia171615:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autia171615
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia171615, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia171615, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
@@ -934,7 +934,7 @@ f_autib171615:
         add     x0, x0, #3
         ldp     x29, x30, [sp], #16
         autib171615
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib171615, basic block .LBB{{[0-9]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib171615, basic block {{[0-9a-zA-Z.]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1. {{[0-9a-f]+}}: ldp     x29, x30, [sp], #0x10
diff --git a/bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s b/bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s
index e9401e4823927..f41017da690c4 100644
--- a/bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s
+++ b/bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s
@@ -15,7 +15,7 @@ f_crossbb1:
 1:
         ret
         .size f_crossbb1, .-f_crossbb1
-// CHECK-LABEL:     GS-PACRET: non-protected ret found in function f_crossbb1, basic block .L{{[^,]+}}, at address
+// CHECK-LABEL:     GS-PACRET: non-protected ret found in function f_crossbb1, basic block {{[^,]+}}, at address
 // CHECK-NEXT:  The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:  The 2 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:  1.     {{[0-9a-f]+}}:      ldp     x29, x30, [sp], #0x10
@@ -37,7 +37,7 @@ f_mergebb1:
 1:
         ret
         .size f_mergebb1, .-f_mergebb1
-// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block .L{{[^,]+}}, at address
+// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block {{[^,]+}}, at address
 // CHECK-NEXT:    The return instruction is     {{[0-9a-f]+}}:       ret
 // CHECK-NEXT:    The 1 instructions that write to the return register after any authentication are:
 // CHECK-NEXT:    1.     {{[0-9a-f]+}}:      ldp     x29, x30, [sp], #0x10

@kbeyls
Copy link
Collaborator Author

kbeyls commented Feb 24, 2025

This is just a tweak to the test files to fix failures on some of the bots. No need for detailed review here.

Most of the premerge checks have passed. I'm going to merge this to (hopefully) fix the post-merge bots.

@kbeyls kbeyls merged commit 55c76ea into llvm:main Feb 24, 2025
10 of 11 checks passed
@alanzhao1
Copy link
Contributor

Thanks for your work on this! I'm still getting the following failure:

FAIL: BOLT :: binary-analysis/AArch64/gs-pacret-autiasp.s (154 of 518)
******************** TEST 'BOLT :: binary-analysis/AArch64/gs-pacret-autiasp.s' FAILED ********************
Exit Code: 1

Command Output (stderr):
--
RUN: at line 1: /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang  --target=x86_64-unknown-linux-gnu -fPIE -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -Wl,--build-id=none -pie --target=aarch64-linux-gnu -nostartfiles -nostdlib -ffreestanding -march=armv9.5-a+pauth-lr -mbranch-protection=pac-ret /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/../../Inputs/asm_main.c -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/binary-analysis/AArch64/Output/gs-pacret-autiasp.s.tmp.exe
+ /usr/local/google/home/ayzhao/src/llvm-project/build/bin/clang --target=x86_64-unknown-linux-gnu -fPIE -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -Wl,--build-id=none -pie --target=aarch64-linux-gnu -nostartfiles -nostdlib -ffreestanding -march=armv9.5-a+pauth-lr -mbranch-protection=pac-ret /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/../../Inputs/asm_main.c -o /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/binary-analysis/AArch64/Output/gs-pacret-autiasp.s.tmp.exe
ld.lld: warning: cannot find entry symbol _start; not setting start address
RUN: at line 2: /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt-binary-analysis --scanners=pacret /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/binary-analysis/AArch64/Output/gs-pacret-autiasp.s.tmp.exe 2>&1 | /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
+ /usr/local/google/home/ayzhao/src/llvm-project/build/bin/llvm-bolt-binary-analysis --scanners=pacret /usr/local/google/home/ayzhao/src/llvm-project/build/tools/bolt/test/binary-analysis/AArch64/Output/gs-pacret-autiasp.s.tmp.exe
+ /usr/local/google/home/ayzhao/src/llvm-project/build/bin/FileCheck /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s
/usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s:42:17: error: CHECK-LABEL: expected string not found in input
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite1, basic block .LBB
                ^
<stdin>:8:82: note: scanning from here
GS-PACRET: non-protected ret found in function f1, basic block .Ltmp0, at address 10270
                                                                                 ^
<stdin>:17:1: note: possible intended match here
GS-PACRET: non-protected ret found in function f_intermediate_overwrite1, basic block .Ltmp1, at address 10290
^

Input file: <stdin>
Check file: /usr/local/google/home/ayzhao/src/llvm-project/bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: BOLT-INFO: shared object or position-independent executable detected
            2: BOLT-INFO: Target architecture: aarch64
            3: BOLT-INFO: BOLT version: b335d5a8303250cb49901ecae7570adf61abbd3c
            4: BOLT-INFO: first alloc address is 0x0
            5: BOLT-INFO: creating new program header table at address 0x200000, offset 0x200000
            6: BOLT-WARNING: non-relocation mode for AArch64 is not fully supported
            7:
            8: GS-PACRET: non-protected ret found in function f1, basic block .Ltmp0, at address 10270
label:42'0                                                                                      X~~~~~~ error: no match found
            9:  The return instruction is 00010270: ret
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           10:  The 1 instructions that write to the return register after any authentication are:
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           11:  1. 0001026c: ldp x29, x30, [sp], #0x10
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           12:  This happens in the following basic block:
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           13:  00010268: add x0, x0, #0x3
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           14:  0001026c: ldp x29, x30, [sp], #0x10
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           15:  00010270: ret
label:42'0     ~~~~~~~~~~~~~~~
           16:
label:42'0     ~
           17: GS-PACRET: non-protected ret found in function f_intermediate_overwrite1, basic block .Ltmp1, at address 10290
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
label:42'1     ?                                                                                                               possible intended match
           18:  The return instruction is 00010290: ret
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           19:  The 1 instructions that write to the return register after any authentication are:
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           20:  1. 0001028c: ldp x29, x30, [sp], #0x10
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           21:  This happens in the following basic block:
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           22:  00010284: add x0, x0, #0x3
label:42'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
********************
Failed Tests (1):
  BOLT :: binary-analysis/AArch64/gs-pacret-autiasp.s


Testing Time: 23.89s

Total Discovered Tests: 518
  Skipped          :   7 (1.35%)
  Unsupported      :  40 (7.72%)
  Passed           : 469 (90.54%)
  Expectedly Failed:   1 (0.19%)
  Failed           :   1 (0.19%)

@kbeyls
Copy link
Collaborator Author

kbeyls commented Feb 24, 2025

Thanks for your work on this! I'm still getting the following failure:

Thank you for reporting that @alanzhao1 ! I also noticed. Apparently something changed in how BOLT computes basic blocks between when I created my original pull request and when the PR got merged. Luckily, this should be easily fixable by adapting the regression test. I've done so in PR #128576. I'll be merging that in a minute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants