From 631bcbf1e550b422b6b32ea3c4328bc848ec81ac Mon Sep 17 00:00:00 2001 From: dongyuzhen Date: Fri, 22 Sep 2023 09:17:27 +0000 Subject: [PATCH] Backport some upstream patches --- ...ereference-occurs-when-memory-alloca.patch | 36 +++++++++++++++++++ openssl.spec | 6 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 backport-A-null-pointer-dereference-occurs-when-memory-alloca.patch diff --git a/backport-A-null-pointer-dereference-occurs-when-memory-alloca.patch b/backport-A-null-pointer-dereference-occurs-when-memory-alloca.patch new file mode 100644 index 0000000..afd87ba --- /dev/null +++ b/backport-A-null-pointer-dereference-occurs-when-memory-alloca.patch @@ -0,0 +1,36 @@ +From a8da305fa3dd6e34ba5aab3978281f652fd12883 Mon Sep 17 00:00:00 2001 +From: yangyangtiantianlonglong +Date: Mon, 31 Jul 2023 07:04:41 -0700 +Subject: [PATCH] A null pointer dereference occurs when memory allocation + fails + +Fixes #21605 + +Reviewed-by: Hugo Landau +Reviewed-by: Matthias St. Pierre +Reviewed-by: Paul Dale +(Merged from https://github.com/openssl/openssl/pull/21606) +--- + ssl/ssl_sess.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c +index cda6b7cc5b..2a5d21be79 100644 +--- a/ssl/ssl_sess.c ++++ b/ssl/ssl_sess.c +@@ -139,8 +139,11 @@ SSL_SESSION *ssl_session_dup(SSL_SESSION *src, int ticket) + dest->references = 1; + + dest->lock = CRYPTO_THREAD_lock_new(); +- if (dest->lock == NULL) ++ if (dest->lock == NULL) { ++ OPENSSL_free(dest); ++ dest = NULL; + goto err; ++ } + + if (!CRYPTO_new_ex_data(CRYPTO_EX_INDEX_SSL_SESSION, dest, &dest->ex_data)) + goto err; +-- +2.27.0 + diff --git a/openssl.spec b/openssl.spec index 0041cc5..01c727b 100644 --- a/openssl.spec +++ b/openssl.spec @@ -4,7 +4,7 @@ Name: openssl Epoch: 1 Version: 3.0.9 -Release: 5 +Release: 6 Summary: Cryptography and SSL/TLS Toolkit License: OpenSSL and SSLeay URL: https://www.openssl.org/ @@ -35,6 +35,7 @@ Patch21: backport-dhtest.c-Add-test-of-DH_check-with-q-p-1.patch Patch22: Backport-support-decode-SM2-parameters.patch Patch23: Feature-support-SM2-CMS-signature.patch Patch24: Feature-use-default-id-if-SM2-id-is-not-set.patch +Patch25: backport-A-null-pointer-dereference-occurs-when-memory-alloca.patch BuildRequires: gcc gcc-c++ perl make lksctp-tools-devel coreutils util-linux zlib-devel Requires: coreutils %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release} @@ -261,6 +262,9 @@ make test || : %endif %changelog +* Fri Sep 22 2023 dongyuzhen - 1:3.0.9-6 +- Backport some upstream patches + * Wed Sep 13 2023 taoyuxiang - 1:3.0.9-5 - add sub rpm openssl-relocation -- Gitee