Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/coreclr/vm/arm64/asmhelpers.S
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,16 @@ NESTED_END OnHijackTripThread, _TEXT
// void* PacStripPtr(void *);
// This function strips the pointer of PAC info that is passed as an argument.
// We prefer to strip a pointer where it's not going to be used to branch execution to.
// It is a no-op on non-PAC enabled machines.
.arch_extension pauth
LEAF_ENTRY PacStripPtr, _TEXT
xpaci x0
ret
LEAF_END PacStripPtr, _TEXT
NESTED_ENTRY PacStripPtr, _TEXT, NoHandler
PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -16
mov lr, x0
xpaclri
mov x0, lr
EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, 16
EPILOG_RETURN
NESTED_END PacStripPtr, _TEXT

// void* PacSignPtr(void *, void *);
// This function signs the input pointer using x1 as salt. It is a no-op on non-PAC enabled machines.
Expand Down
13 changes: 9 additions & 4 deletions src/coreclr/vm/arm64/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,15 @@ OnHijackTripThreadReturn
; void* PacStripPtr(void *);
; This function strips the pointer of PAC info that is passed as an argument.
; We prefer to strip a pointer where it's not going to be used to branch execution to.
LEAF_ENTRY PacStripPtr
DCD 0xDAC143E0 ; xpaci x0 instruction in binary to avoid requiring PAC-enabled assemblers
ret
LEAF_END PacStripPtr
; It is a no-op on non-PAC enabled machines.
NESTED_ENTRY PacStripPtr
PROLOG_SAVE_REG_PAIR fp, lr, #-16!
mov lr, x0
DCD 0xD50320FF ; xpaclri instruction in binary to avoid requiring PAC-enabled assemblers
mov x0, lr
EPILOG_RESTORE_REG_PAIR fp, lr, #16!
EPILOG_RETURN
NESTED_END

; void* PacSignPtr(void *, void *);
; This function signs the input pointer using x1 as salt. It is a no-op on non-PAC enabled machines.
Expand Down