]> git.ipfire.org Git - thirdparty/openssl.git/commit
SHA512/x86_64: Fix SIGSEGV on $avx=0 path
authorStanciu, Adrian <adrian.stanciu@intel.com>
Tue, 6 May 2025 17:24:36 +0000 (10:24 -0700)
committerPauli <ppzgs1@gmail.com>
Thu, 8 May 2025 23:33:37 +0000 (09:33 +1000)
commitce76714966227a2ba6a4ef80c2bd78bb36f6cffd
tree8b2cbf983f9194daf8c442f6d92bb221361b7793
parentf4d9904763e59db031007f4a938f1f8b96fdcee7
SHA512/x86_64: Fix SIGSEGV on $avx=0 path

Fixes #27555

When $avx>1, codegen is:
    lea OPENSSL_ia32cap_P(%rip),%r10
    mov 0(%r10),%r9
    mov 8(%r10),%r11d
    mov 20(%r10),%r10d

When $avx is true, codegen was:
    lea OPENSSL_ia32cap_P(%rip),%r10
    mov 0(%r10),%r9
    mov 8(%r10),%r11d
    mov 20(%r10),%r10d    # not used by dispatcher

When $avx=0, codegen was:
    mov 20(%r10),%r10d    # %r10 not initalized, causing SIGSEGV

After fix, `mov 20(%r10),%r10d` is only included when $avx>1

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/27574)
crypto/sha/asm/sha512-x86_64.pl