!226 [sync] PR-221: Backport-CVE-2023-1255

From: @openeuler-sync-bot 
Reviewed-by: @zcfsite 
Signed-off-by: @zcfsite
This commit is contained in:
openeuler-ci-bot 2023-05-17 06:24:59 +00:00 committed by Gitee
commit 5d077d76a0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 94 additions and 1 deletions

View File

@ -0,0 +1,89 @@
From e1e1125b5ce110ef53770b4e6e18a34f772ab6eb Mon Sep 17 00:00:00 2001
From: wzc <u201911736@hust.edu.cn>
Date: Wed, 26 Apr 2023 17:08:15 +0800
Subject: [PATCH 60/60] backport-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 <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/20759)
(cherry picked from commit 72dfe46550ee1f1bbfacd49f071419365bc23304)
---
CHANGES.md | 10 ++++++++++
NEWS.md | 2 ++
...//crypto/aes/asm/aesv8-armx.pl | 4 +++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/CHANGES.md b/CHANGES.md
index 7cdd9d9..6c33bf9 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -30,6 +30,15 @@ breaking changes, and mappings for the large list of deprecated functions.
### Changes between 3.0.7 and 3.0.8 [7 Feb 2023]
+ * Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms which
+ happens if the buffer size is 4 mod 5. This can trigger a crash of an
+ application using AES-XTS decryption if the memory just after the buffer
+ being decrypted is not mapped.
+ Thanks to Anton Romanov (Amazon) for discovering the issue.
+ ([CVE-2023-1255])
+
+ *Nevine Ebeid*
+
* Fixed NULL dereference during PKCS7 data verification.
A NULL pointer can be dereferenced when signatures are being
@@ -19578,6 +19587,7 @@ ndif
<!-- Links -->
+[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
[CVE-2023-0401]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0401
[CVE-2023-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0286
[CVE-2023-0217]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0217
diff --git a/NEWS.md b/NEWS.md
index 36dbfa7..86b1410 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -20,6 +20,7 @@ OpenSSL 3.0
### Major changes between OpenSSL 3.0.7 and OpenSSL 3.0.8 [7 Feb 2023]
+ * Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms ([CVE-2023-1255])
* Fixed NULL dereference during PKCS7 data verification ([CVE-2023-0401])
* Fixed X.400 address type confusion in X.509 GeneralName ([CVE-2023-0286])
* Fixed NULL dereference validating DSA public key ([CVE-2023-0217])
@@ -1430,6 +1431,7 @@ OpenSSL 0.9.x
* Support for various new platforms
<!-- Links -->
+[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
[CVE-2023-0401]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0401
[CVE-2023-0286]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0286
[CVE-2023-0217]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0217
diff --git a/crypto/aes/asm/aesv8-armx.pl b/crypto/aes/asm/aesv8-armx.pl
index 6a7bf05..5701373 100644
--- 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.37.0.windows.1

View File

@ -2,7 +2,7 @@
Name: openssl Name: openssl
Epoch: 1 Epoch: 1
Version: 3.0.8 Version: 3.0.8
Release: 5 Release: 6
Summary: Cryptography and SSL/TLS Toolkit Summary: Cryptography and SSL/TLS Toolkit
License: OpenSSL and SSLeay License: OpenSSL and SSLeay
URL: https://www.openssl.org/ 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 Patch18: backport-Ensure-that-EXFLAG_INVALID_POLICY-is-checked-even-in.patch
Patch19: backport-Generate-some-certificates-with-the-certificatePolic.patch Patch19: backport-Generate-some-certificates-with-the-certificatePolic.patch
Patch20: backport-Fix-documentation-of-X509_VERIFY_PARAM_add0_policy.patch Patch20: backport-Fix-documentation-of-X509_VERIFY_PARAM_add0_policy.patch
Patch21: backport-CVE-2023-1255.patch
BuildRequires: gcc gcc-c++ perl make lksctp-tools-devel coreutils util-linux zlib-devel BuildRequires: gcc gcc-c++ perl make lksctp-tools-devel coreutils util-linux zlib-devel
Requires: coreutils %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} Requires: coreutils %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
@ -229,6 +230,9 @@ make test || :
%ldconfig_scriptlets libs %ldconfig_scriptlets libs
%changelog %changelog
* Wed Apr 26 2023 zcwei <u201911736@hust.edu.cn> - 1:3.0.8-6
- fix CVE-2023-1255
* Tue Apr 4 2023 wangcheng <wangcheng156@huawei.com> - 1:3.0.8-5 * Tue Apr 4 2023 wangcheng <wangcheng156@huawei.com> - 1:3.0.8-5
- fix some CVEs - fix some CVEs