]> git.ipfire.org Git - thirdparty/openssl.git/commit
chacha/asm: fix ELFv2 ABI violation in ChaCha20_ctr32_vsx_8x
authorSamaresh Kumar Singh <ssam3003@gmail.com>
Thu, 26 Mar 2026 14:19:22 +0000 (09:19 -0500)
committerNikola Pajkovsky <nikolap@openssl.org>
Sat, 11 Apr 2026 20:12:20 +0000 (22:12 +0200)
commit79d1775e62d47c7fb595caa17d08dded951b6dd6
treea7d9ad1133df9662640b27445ce90b6e38cd61ab
parent9a45802aae2c66d5c422c793f2264477d0013f76
chacha/asm: fix ELFv2 ABI violation in ChaCha20_ctr32_vsx_8x

The 8-block POWER10 ChaCha20 path uses vxxlor to spill VMX values into
VSR0-VSR26, which aliases FPR0-FPR26. FPR14-FPR31 are callee-saved per
the ELFv2 ABI, but the function was never saving or restoring them,
silently corrupting 11 FPRs (12 on big-endian) across any call with a
buffer larger than 255 bytes. VMX registers v20-v23, also
callee-saved, had the same problem.

Fix by increasing the frame size to accommodate save slots for
FPR14-FPR25 (and FPR26 on BE) and VMX v20-v23, and adding the
corresponding stfd/lfd and stvx/lvx pairs in the prologue and
epilogue. The VRSAVE save offset is updated to a fixed expression so
it stays clear of the new save area.

Fix for the bug #30584

Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Sat Apr 11 20:12:57 2026
(Merged from https://github.com/openssl/openssl/pull/30587)
crypto/chacha/asm/chachap10-ppc.pl