From a83e4d7c4a5f3660e22975561bc72b9f114f01c4 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Mon, 16 Nov 2015 17:47:54 +0100 Subject: [PATCH] fix sigill on some AMD CPUs (#1278194) --- openssl-1.0.2d-amd-sigill.patch | 17 +++++++++++++++++ openssl.spec | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 openssl-1.0.2d-amd-sigill.patch diff --git a/openssl-1.0.2d-amd-sigill.patch b/openssl-1.0.2d-amd-sigill.patch new file mode 100644 index 0000000..91f17d9 --- /dev/null +++ b/openssl-1.0.2d-amd-sigill.patch @@ -0,0 +1,17 @@ +diff -up openssl-1.0.2d/crypto/aes/asm/aesni-sha256-x86_64.pl.sigill openssl-1.0.2d/crypto/aes/asm/aesni-sha256-x86_64.pl +--- openssl-1.0.2d/crypto/aes/asm/aesni-sha256-x86_64.pl.sigill 2015-07-09 16:51:25.000000000 +0200 ++++ openssl-1.0.2d/crypto/aes/asm/aesni-sha256-x86_64.pl 2015-11-16 17:43:52.554826505 +0100 +@@ -139,11 +139,8 @@ $code.=<<___ if ($avx>1); + je ${func}_avx2 + ___ + $code.=<<___; +- and \$`1<<30`,%eax # mask "Intel CPU" bit +- and \$`1<<28|1<<9`,%r10d # mask AVX+SSSE3 bits +- or %eax,%r10d +- cmp \$`1<<28|1<<9|1<<30`,%r10d +- je ${func}_avx ++ and \$`1<<28`,%r10d # check for AVX ++ jnz ${func}_avx + ud2 + ___ + } diff --git a/openssl.spec b/openssl.spec index 7737853..6472339 100644 --- a/openssl.spec +++ b/openssl.spec @@ -23,7 +23,7 @@ Summary: Utilities from the general purpose cryptography library with TLS implementation Name: openssl Version: 1.0.2d -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 1 # We have to remove certain patented algorithms from the openssl source # tarball with the hobble-openssl script which is included below. @@ -86,6 +86,7 @@ Patch94: openssl-1.0.2d-secp256k1.patch Patch80: openssl-1.0.2a-wrap-pad.patch Patch81: openssl-1.0.2a-padlock64.patch Patch82: openssl-1.0.2c-trusted-first-doc.patch +Patch83: openssl-1.0.2d-amd-sigill.patch License: OpenSSL Group: System Environment/Libraries @@ -207,6 +208,7 @@ cp %{SOURCE12} %{SOURCE13} crypto/ec/ %patch80 -p1 -b .wrap %patch81 -p1 -b .padlock64 %patch82 -p1 -b .trusted-first +%patch83 -p1 -b .sigill sed -i 's/SHLIB_VERSION_NUMBER "1.0.0"/SHLIB_VERSION_NUMBER "%{version}"/' crypto/opensslv.h @@ -477,6 +479,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/fipscanister.* %postun libs -p /sbin/ldconfig %changelog +* Mon Nov 16 2015 Tomáš Mráz 1.0.2d-3 +- fix sigill on some AMD CPUs (#1278194) + * Wed Aug 12 2015 Tom Callaway 1.0.2d-2 - re-enable secp256k1 (bz1021898)