Skip to content

Commit

Permalink
crypto/poly1305/asm: fix armv8 pointer authentication
Browse files Browse the repository at this point in the history
PAC pointer authentication signs the return address against the value
of the stack pointer, to prevent stack overrun exploits from corrupting
the control flow. However, this requires that the AUTIASP is issued with
SP holding the same value as it held when the PAC value was generated.
The Poly1305 armv8 code got this wrong, resulting in crashes on PAC
capable hardware.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from #13256)

(cherry picked from commit fcf6e9d)
  • Loading branch information
Ard Biesheuvel authored and t8m committed Oct 29, 2020
1 parent 8979ffe commit 5795acf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/poly1305/asm/poly1305-armv8.pl
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,8 @@
st1 {$ACC4}[0],[$ctx]
.Lno_data_neon:
.inst 0xd50323bf // autiasp
ldr x29,[sp],#80
.inst 0xd50323bf // autiasp
ret
.size poly1305_blocks_neon,.-poly1305_blocks_neon
Expand Down

0 comments on commit 5795acf

Please sign in to comment.