Skip to content

PAC with collisions #1235

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

PAC with collisions #1235

wants to merge 3 commits into from

Conversation

RemyCiterin
Copy link
Contributor

@RemyCiterin RemyCiterin commented Mar 20, 2025

This PR extend the previous PR I did for Pointer Authentication Code to add the support for hash collisions, for example a program like this one:

AArch64 Simple Collision
Variant=pac,fpac
{ 0:X0=x }
P0                  ;
  PACDZA X0 ;
  AUTDZB X0;
exists ( ~Fault(P0) )

may run without fault because of a hash collision between pacda(x,0) and pacdb(x,0). But this program:

AArch64 Collision contradiction
Variant=pac,fpac
{ 0:X0=x; 0:X1=x;; }
P0;
  PACDZA X1   ;
  PACDZB X0   ;
  CMP X0,X1   ;
  B.EQ finish ;
  AUTDZA X0   ;
  MOV X2,#1   ;
finish:       ;
exists (~Fault(P0) /\ 0:X2=1)

can't return without fault and 0:X2=1 because otherwise their is a contradiction about the same collision. And herd will return (ideally with some debug flags because this output is not possible in litmus):

Test Collision Allowed
States 2
0:X2=0;  ~Fault(P0); pacda(x, 0x0)=pacdb(x, 0x0);
0:X2=0; Fault(P0,PacCheck:DA);
No
Witnesses
Positive: 0 Negative: 2
Condition exists (not (fault(P0)) /\ 0:X2=1)
Observation Collision Never 0 2
Time Collision 0.01
Hash=e743d111643250ebd8d3bb2a4c991cf9

This PR is till not 100% finish, I still have some update to do, as example: ensure that the pretty printing by default is the same between herd and litmus like I did for the version without collisions, moving the docs from pac_tests...

@RemyCiterin RemyCiterin force-pushed the master branch 7 times, most recently from e4df7e2 to 593656d Compare April 2, 2025 10:38
@RemyCiterin RemyCiterin force-pushed the master branch 4 times, most recently from 6d3e441 to 72902ca Compare April 14, 2025 12:02
@RemyCiterin RemyCiterin force-pushed the master branch 2 times, most recently from ad2e9c1 to 50d5c95 Compare April 22, 2025 10:19
@RemyCiterin RemyCiterin force-pushed the master branch 5 times, most recently from bf05083 to aca23e5 Compare May 1, 2025 09:24
@RemyCiterin RemyCiterin force-pushed the master branch 4 times, most recently from ce61ed5 to de14fe3 Compare May 6, 2025 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant