]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix register save/restore issue in ppc master
authorNeil Horman <nhorman@openssl.org>
Wed, 31 Dec 2025 21:38:21 +0000 (16:38 -0500)
committerNeil Horman <nhorman@openssl.org>
Wed, 31 Dec 2025 21:38:21 +0000 (16:38 -0500)
commit441a2c105c7074502b0dc4ccd4aa2ed11d305556
treee7325b001cc7a681690fe37384755d3f420d27ed
parent9aeb35372fd0d988b257e2e633754ea5df83d353
Fix register save/restore issue in ppc

Recently, the addition of some vector register save restore logic from:
https://github.com/openssl/openssl/pull/28990

Triggered an issue in our quic_multistream_test, notably causing a
connection shutdown with error code 1, rather than successful
completion.

The problem has been root caused to an error in how the ppc aes code
saves and restores vector registers.

The aes gcm code uses VSR instructions (vsldoi, etc), to maniuplate
vector registers, which only operate on the upper half of the vector
register file (VS32-63), and operands are implicitly offset to do this.
(i.e. <instr> v31 actually operates on register vs63).

However, the SAVE/RESTORE macros which save and restore those values use
stxv/lxv instructions to do the save and restore, which are VSX
instructions that have access to the full vector register file, and so
by restoring V1, rather than V33, etc, we actuall restore values to the
wrong registers, causing various issues (most notably the above
misconfiguration of the quic SSL shutdown event, which sets the error
code erroneously to 1 instead of the expected 0 value).

Fix it by offsetting the SAVE_REGS and RESTORE_REGS macros to reference
the proper registers when doing save and restore.

Fixes #29516

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/29528)
crypto/modes/asm/aes-gcm-ppc.pl