Skip to content

Commit e6b0357

Browse files
committed
Account for improved nocfg analysis: update the tests
1 parent 9757d5e commit e6b0357

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -454,43 +454,36 @@ good_call_nocfg:
454454
.type good_branch_nocfg,@function
455455
good_branch_nocfg:
456456
// CHECK-NOT: good_branch_nocfg
457-
paciasp
458457
adr x2, 1f
459458
br x2
460459
1:
461460
autia x0, x1
462-
autiasp // authenticate LR before tail call
463-
ldr x2, [x30] // check LR before tail call
464461
br x0
465462
.size good_branch_nocfg, .-good_branch_nocfg
466463

467464
.globl good_load_other_reg_nocfg
468465
.type good_load_other_reg_nocfg,@function
469466
good_load_other_reg_nocfg:
470467
// CHECK-NOT: good_load_other_reg_nocfg
471-
paciasp
472468
adr x2, 1f
473469
br x2
474470
1:
475471
autia x0, x1
476472
ldr x2, [x0]
477473

478-
autiasp
479474
ret
480475
.size good_load_other_reg_nocfg, .-good_load_other_reg_nocfg
481476

482477
.globl good_load_same_reg_nocfg
483478
.type good_load_same_reg_nocfg,@function
484479
good_load_same_reg_nocfg:
485480
// CHECK-NOT: good_load_same_reg_nocfg
486-
paciasp
487481
adr x2, 1f
488482
br x2
489483
1:
490484
autia x0, x1
491485
ldr x0, [x0]
492486

493-
autiasp
494487
ret
495488
.size good_load_same_reg_nocfg, .-good_load_same_reg_nocfg
496489

@@ -502,13 +495,11 @@ bad_unchecked_nocfg:
502495
// CHECK-LABEL: GS-PAUTH: authentication oracle found in function bad_unchecked_nocfg, at address
503496
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1
504497
// CHECK-NEXT: The 0 instructions that leak the affected registers are:
505-
paciasp
506498
adr x2, 1f
507499
br x2
508500
1:
509501
autia x0, x1
510502

511-
autiasp
512503
ret
513504
.size bad_unchecked_nocfg, .-bad_unchecked_nocfg
514505

@@ -542,15 +533,13 @@ bad_unknown_usage_read_nocfg:
542533
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1
543534
// CHECK-NEXT: The 1 instructions that leak the affected registers are:
544535
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mul x3, x0, x1
545-
paciasp
546536
adr x2, 1f
547537
br x2
548538
1:
549539
autia x0, x1
550540
mul x3, x0, x1
551541
ldr x2, [x0]
552542

553-
autiasp
554543
ret
555544
.size bad_unknown_usage_read_nocfg, .-bad_unknown_usage_read_nocfg
556545

@@ -561,15 +550,13 @@ bad_unknown_usage_subreg_read_nocfg:
561550
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1
562551
// CHECK-NEXT: The 1 instructions that leak the affected registers are:
563552
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mul w3, w0, w1
564-
paciasp
565553
adr x2, 1f
566554
br x2
567555
1:
568556
autia x0, x1
569557
mul w3, w0, w1
570558
ldr x2, [x0]
571559

572-
autiasp
573560
ret
574561
.size bad_unknown_usage_subreg_read_nocfg, .-bad_unknown_usage_subreg_read_nocfg
575562

@@ -580,38 +567,33 @@ bad_unknown_usage_update_nocfg:
580567
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: autia x0, x1
581568
// CHECK-NEXT: The 1 instructions that leak the affected registers are:
582569
// CHECK-NEXT: 1. {{[0-9a-f]+}}: movk x0, #0x2a, lsl #16
583-
paciasp
584570
adr x2, 1f
585571
br x2
586572
1:
587573
autia x0, x1
588574
movk x0, #42, lsl #16 // does not overwrite x0 completely
589575
ldr x2, [x0]
590576

591-
autiasp
592577
ret
593578
.size bad_unknown_usage_update_nocfg, .-bad_unknown_usage_update_nocfg
594579

595580
.globl good_unknown_overwrite_nocfg
596581
.type good_unknown_overwrite_nocfg,@function
597582
good_unknown_overwrite_nocfg:
598583
// CHECK-NOT: good_unknown_overwrite_nocfg
599-
paciasp
600584
adr x2, 1f
601585
br x2
602586
1:
603587
autia x0, x1
604588
mul x0, x1, x2
605589

606-
autiasp
607590
ret
608591
.size good_unknown_overwrite_nocfg, .-good_unknown_overwrite_nocfg
609592

610593
.globl good_address_arith_nocfg
611594
.type good_address_arith_nocfg,@function
612595
good_address_arith_nocfg:
613596
// CHECK-NOT: good_address_arith_nocfg
614-
paciasp
615597
adr x2, 1f
616598
br x2
617599
1:
@@ -625,7 +607,6 @@ good_address_arith_nocfg:
625607
mov x1, #0
626608
mov x2, #0
627609

628-
autiasp
629610
ret
630611
.size good_address_arith_nocfg, .-good_address_arith_nocfg
631612

bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -505,36 +505,29 @@ bad_one_auted_one_checked_multi_bb:
505505
// * untrusted: not even s-t-d - from arg and from memory
506506
// * untrusted: subreg clobbered - between address materialization and use, between auth and check, between check and use
507507
// * untrusted: first checked then auted, auted then auted, checked then checked
508-
//
509-
// Note that it is important to sign and authenticate LR, as it is not kept
510-
// safe-to-dereference across unconditional branches.
511508

512509
.globl good_sign_addr_mat_nocfg
513510
.type good_sign_addr_mat_nocfg,@function
514511
good_sign_addr_mat_nocfg:
515512
// CHECK-NOT: good_sign_addr_mat_nocfg
516-
paciasp
517513
adr x3, 1f
518514
br x3
519515
1:
520516
adr x0, sym
521517
pacda x0, x1
522-
autiasp
523518
ret
524519
.size good_sign_addr_mat_nocfg, .-good_sign_addr_mat_nocfg
525520

526521
.globl good_sign_auted_checked_ldr_nocfg
527522
.type good_sign_auted_checked_ldr_nocfg,@function
528523
good_sign_auted_checked_ldr_nocfg:
529524
// CHECK-NOT: good_sign_auted_checked_ldr_nocfg
530-
paciasp
531525
adr x3, 1f
532526
br x3
533527
1:
534528
autda x0, x2
535529
ldr x2, [x0]
536530
pacda x0, x1
537-
autiasp
538531
ret
539532
.size good_sign_auted_checked_ldr_nocfg, .-good_sign_auted_checked_ldr_nocfg
540533

@@ -544,13 +537,11 @@ bad_sign_authed_unchecked_nocfg:
544537
// CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_sign_authed_unchecked_nocfg, at address
545538
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
546539
// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are:
547-
paciasp
548540
adr x3, 1f
549541
br x3
550542
1:
551543
autda x0, x2
552544
pacda x0, x1
553-
autiasp
554545
ret
555546
.size bad_sign_authed_unchecked_nocfg, .-bad_sign_authed_unchecked_nocfg
556547

@@ -560,13 +551,11 @@ bad_sign_checked_not_auted_nocfg:
560551
// CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_sign_checked_not_auted_nocfg, at address
561552
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
562553
// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are:
563-
paciasp
564554
adr x3, 1f
565555
br x3
566556
1:
567557
ldr x2, [x0]
568558
pacda x0, x1
569-
autiasp
570559
ret
571560
.size bad_sign_checked_not_auted_nocfg, .-bad_sign_checked_not_auted_nocfg
572561

@@ -576,12 +565,10 @@ bad_sign_plain_arg_nocfg:
576565
// CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_sign_plain_arg_nocfg, at address
577566
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
578567
// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are:
579-
paciasp
580568
adr x3, 1f
581569
br x3
582570
1:
583571
pacda x0, x1
584-
autiasp
585572
ret
586573
.size bad_sign_plain_arg_nocfg, .-bad_sign_plain_arg_nocfg
587574

@@ -592,13 +579,11 @@ bad_sign_plain_mem_nocfg:
592579
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
593580
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
594581
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldr x0, [x1]
595-
paciasp
596582
adr x3, 1f
597583
br x3
598584
1:
599585
ldr x0, [x1]
600586
pacda x0, x1
601-
autiasp
602587
ret
603588
.size bad_sign_plain_mem_nocfg, .-bad_sign_plain_mem_nocfg
604589

@@ -609,14 +594,12 @@ bad_clobber_between_addr_mat_and_use_nocfg:
609594
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
610595
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
611596
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w0, w4
612-
paciasp
613597
adr x3, 1f
614598
br x3
615599
1:
616600
adr x0, sym
617601
mov w0, w4
618602
pacda x0, x1
619-
autiasp
620603
ret
621604
.size bad_clobber_between_addr_mat_and_use_nocfg, .-bad_clobber_between_addr_mat_and_use_nocfg
622605

@@ -627,15 +610,13 @@ bad_clobber_between_auted_and_checked_nocfg:
627610
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
628611
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
629612
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w0, w4
630-
paciasp
631613
adr x3, 1f
632614
br x3
633615
1:
634616
autda x0, x2
635617
mov w0, w4
636618
ldr x2, [x0]
637619
pacda x0, x1
638-
autiasp
639620
ret
640621
.size bad_clobber_between_auted_and_checked_nocfg, .-bad_clobber_between_auted_and_checked_nocfg
641622

@@ -646,15 +627,13 @@ bad_clobber_between_checked_and_used_nocfg:
646627
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
647628
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
648629
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w0, w4
649-
paciasp
650630
adr x3, 1f
651631
br x3
652632
1:
653633
autda x0, x2
654634
ldr x2, [x0]
655635
mov w0, w4
656636
pacda x0, x1
657-
autiasp
658637
ret
659638
.size bad_clobber_between_checked_and_used_nocfg, .-bad_clobber_between_checked_and_used_nocfg
660639

@@ -664,14 +643,12 @@ bad_transition_check_then_auth_nocfg:
664643
// CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_transition_check_then_auth_nocfg, at address
665644
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
666645
// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are:
667-
paciasp
668646
adr x3, 1f
669647
br x3
670648
1:
671649
ldr x2, [x0]
672650
autda x0, x2
673651
pacda x0, x1
674-
autiasp
675652
ret
676653
.size bad_transition_check_then_auth_nocfg, .-bad_transition_check_then_auth_nocfg
677654

@@ -681,14 +658,12 @@ bad_transition_auth_then_auth_nocfg:
681658
// CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_transition_auth_then_auth_nocfg, at address
682659
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
683660
// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are:
684-
paciasp
685661
adr x3, 1f
686662
br x3
687663
1:
688664
autda x0, x2
689665
autda x0, x2
690666
pacda x0, x1
691-
autiasp
692667
ret
693668
.size bad_transition_auth_then_auth_nocfg, .-bad_transition_auth_then_auth_nocfg
694669

@@ -698,14 +673,12 @@ bad_transition_check_then_check_nocfg:
698673
// CHECK-LABEL: GS-PAUTH: signing oracle found in function bad_transition_check_then_check_nocfg, at address
699674
// CHECK-NEXT: The instruction is {{[0-9a-f]+}}: pacda x0, x1
700675
// CHECK-NEXT: The 0 instructions that write to the affected registers after any authentication are:
701-
paciasp
702676
adr x3, 1f
703677
br x3
704678
1:
705679
ldr x2, [x0]
706680
ldr x2, [x0]
707681
pacda x0, x1
708-
autiasp
709682
ret
710683
.size bad_transition_check_then_check_nocfg, .-bad_transition_check_then_check_nocfg
711684

0 commit comments

Comments
 (0)