From 893ab01dfa6958e1d7dee07a95331527d2bf7ca7 Mon Sep 17 00:00:00 2001 From: houmingyong Date: Wed, 17 May 2023 10:32:59 +0800 Subject: [PATCH] fix the CVE-2023-1255 --- ...oid-buffer-overrread-in-AES-XTS-decr.patch | 45 +++++++++++++++++++ openssl.spec | 6 ++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 backport-CVE-2023-1255-aesv8-armx.pl-Avoid-buffer-overrread-in-AES-XTS-decr.patch diff --git a/backport-CVE-2023-1255-aesv8-armx.pl-Avoid-buffer-overrread-in-AES-XTS-decr.patch b/backport-CVE-2023-1255-aesv8-armx.pl-Avoid-buffer-overrread-in-AES-XTS-decr.patch new file mode 100644 index 0000000..a4c3648 --- /dev/null +++ b/backport-CVE-2023-1255-aesv8-armx.pl-Avoid-buffer-overrread-in-AES-XTS-decr.patch @@ -0,0 +1,45 @@ +From 02ac9c9420275868472f33b01def01218742b8bb Mon Sep 17 00:00:00 2001 +From: Tomas Mraz +Date: Mon, 17 Apr 2023 16:51:20 +0200 +Subject: [PATCH] aesv8-armx.pl: Avoid buffer overrread in AES-XTS decryption + +Original author: Nevine Ebeid (Amazon) +Fixes: CVE-2023-1255 + +The buffer overread happens on decrypts of 4 mod 5 sizes. +Unless the memory just after the buffer is unmapped this is harmless. + +Reviewed-by: Paul Dale +Reviewed-by: Tom Cosgrove +(Merged from https://github.com/openssl/openssl/pull/20759) + +(cherry picked from commit 72dfe46550ee1f1bbfacd49f071419365bc23304) +--- + crypto/aes/asm/aesv8-armx.pl | 4 +++- + 3 files changed, 16 insertions(+), 1 deletion(-) + +diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl +index 6a7bf05d1b..bd583e2c89 100755 +--- a/crypto/aes/asm/aesv8-armx.pl ++++ b/crypto/aes/asm/aesv8-armx.pl +@@ -3353,7 +3353,7 @@ $code.=<<___ if ($flavour =~ /64/); + .align 4 + .Lxts_dec_tail4x: + add $inp,$inp,#16 +- vld1.32 {$dat0},[$inp],#16 ++ tst $tailcnt,#0xf + veor $tmp1,$dat1,$tmp0 + vst1.8 {$tmp1},[$out],#16 + veor $tmp2,$dat2,$tmp2 +@@ -3362,6 +3362,8 @@ $code.=<<___ if ($flavour =~ /64/); + veor $tmp4,$dat4,$tmp4 + vst1.8 {$tmp3-$tmp4},[$out],#32 + ++ b.eq .Lxts_dec_abort ++ vld1.32 {$dat0},[$inp],#16 + b .Lxts_done + .align 4 + .Lxts_outer_dec_tail: +-- +2.27.0 + diff --git a/openssl.spec b/openssl.spec index 2863936..87cad7b 100644 --- a/openssl.spec +++ b/openssl.spec @@ -2,7 +2,7 @@ Name: openssl Epoch: 1 Version: 3.0.8 -Release: 5 +Release: 6 Summary: Cryptography and SSL/TLS Toolkit License: OpenSSL and SSLeay URL: https://www.openssl.org/ @@ -29,6 +29,7 @@ Patch17: backport-Add-a-Certificate-Policies-Test.patch Patch18: backport-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch Patch19: backport-Generate-some-certificates-with-the-certificatePolic.patch Patch20: backport-Fix-documentation-of-X509_VERIFY_PARAM_add0_policy.patch +Patch21: backport-CVE-2023-1255-aesv8-armx.pl-Avoid-buffer-overrread-in-AES-XTS-decr.patch BuildRequires: gcc gcc-c++ perl make lksctp-tools-devel coreutils util-linux zlib-devel Requires: coreutils %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -229,6 +230,9 @@ make test || : %ldconfig_scriptlets libs %changelog +* Wed May 17 2023 wangcheng - 1:3.0.8-6 +- fix CVE-2023-1255 CVE + * Tue Apr 4 2023 wangcheng - 1:3.0.8-5 - fix some CVEs -- Gitee