From 32e7dd9cdcd12ec3340744f6d14b743f4436d61f Mon Sep 17 00:00:00 2001 From: Renbo Date: Mon, 4 Jul 2022 15:02:52 +0800 Subject: [PATCH 1/2] update to php-7.4.19-3.module+el8.6.0+15726+994cde98 Signed-off-by: Renbo --- php-CVE-2022-31626.patch | 23 +++++++++++++++++++++++ php.spec | 14 ++++++-------- 2 files changed, 29 insertions(+), 8 deletions(-) create mode 100644 php-CVE-2022-31626.patch diff --git a/php-CVE-2022-31626.patch b/php-CVE-2022-31626.patch new file mode 100644 index 0000000..7f89dcb --- /dev/null +++ b/php-CVE-2022-31626.patch @@ -0,0 +1,23 @@ +From 58006537fc5f133ae8549efe5118cde418b3ace9 Mon Sep 17 00:00:00 2001 +From: Stanislav Malyshev +Date: Mon, 6 Jun 2022 00:56:51 -0600 +Subject: [PATCH] Fix bug #81719: mysqlnd/pdo password buffer overflow + +--- + ext/mysqlnd/mysqlnd_wireprotocol.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c +index 87b2e7c31331..e4a298adaea4 100644 +--- a/ext/mysqlnd/mysqlnd_wireprotocol.c ++++ b/ext/mysqlnd/mysqlnd_wireprotocol.c +@@ -771,7 +771,8 @@ php_mysqlnd_change_auth_response_write(MYSQLND_CONN_DATA * conn, void * _packet) + MYSQLND_VIO * vio = conn->vio; + MYSQLND_STATS * stats = conn->stats; + MYSQLND_CONNECTION_STATE * connection_state = &conn->state; +- zend_uchar * const buffer = pfc->cmd_buffer.length >= packet->auth_data_len? pfc->cmd_buffer.buffer : mnd_emalloc(packet->auth_data_len); ++ size_t total_packet_size = packet->auth_data_len + MYSQLND_HEADER_SIZE; ++ zend_uchar * const buffer = pfc->cmd_buffer.length >= total_packet_size? pfc->cmd_buffer.buffer : mnd_emalloc(total_packet_size); + zend_uchar * p = buffer + MYSQLND_HEADER_SIZE; /* start after the header */ + + DBG_ENTER("php_mysqlnd_change_auth_response_write"); diff --git a/php.spec b/php.spec index b9bc4c4..afcefca 100644 --- a/php.spec +++ b/php.spec @@ -1,4 +1,3 @@ -%define anolis_release .0.1 # RHEL / Fedora spec file for php # # License: MIT @@ -61,7 +60,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php Version: %{upver}%{?rcver:~%{rcver}} -Release: 2%{anolis_release}%{?dist} +Release: 3%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -111,13 +110,12 @@ Patch47: php-5.6.3-phpinfo.patch # Security fixes (200+) Patch200: php-7.4.19-CVE-2021-21703.patch Patch201: php-7.4.19-CVE-2021-21705.patch +Patch202: php-CVE-2022-31626.patch # Fixes for tests (300+) # Factory is droped from system tzdata Patch300: php-5.6.3-datetests.patch -Patch1000: 1000-anolis-php-support-loongarch64.patch - BuildRequires: gnupg2 BuildRequires: bzip2-devel @@ -725,12 +723,11 @@ in pure PHP. # security patches %patch200 -p1 -b .cve21705 %patch201 -p1 -b .cve21703 +%patch202 -p1 -b .cve31626 # Fixes for tests %patch300 -p1 -b .datetests -%patch1000 -p1 - # Prevent %%doc confusion over LICENSE files cp Zend/LICENSE Zend/ZEND_LICENSE @@ -1518,8 +1515,9 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || : %changelog -* Wed Apr 20 2022 Liwei Ge - 7.4.19-2.0.1 -- Support loongarch64 platform +* Wed Jun 22 2022 Remi Collet - 7.4.19-3 +- fix password of excessive length triggers buffer overflow leading to RCE + CVE-2022-31626 * Wed Jan 19 2022 Remi Collet - 7.4.19-2 - fix SSRF bypass in FILTER_VALIDATE_URL -- Gitee From 19f5c741bcb75237e1a871c5883e36552f3c3740 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Mon, 8 Nov 2021 21:59:28 +0800 Subject: [PATCH 2/2] build: support loongarch64 platform Signed-off-by: Liwei Ge --- php.spec | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/php.spec b/php.spec index afcefca..3d0d3b3 100644 --- a/php.spec +++ b/php.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 # RHEL / Fedora spec file for php # # License: MIT @@ -60,7 +61,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php Version: %{upver}%{?rcver:~%{rcver}} -Release: 3%{?dist} +Release: 3%{anolis_release}%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -116,6 +117,8 @@ Patch202: php-CVE-2022-31626.patch # Factory is droped from system tzdata Patch300: php-5.6.3-datetests.patch +Patch1000: 1000-anolis-php-support-loongarch64.patch + BuildRequires: gnupg2 BuildRequires: bzip2-devel @@ -728,6 +731,8 @@ in pure PHP. # Fixes for tests %patch300 -p1 -b .datetests +%patch1000 -p1 + # Prevent %%doc confusion over LICENSE files cp Zend/LICENSE Zend/ZEND_LICENSE @@ -1515,6 +1520,9 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || : %changelog +* Mon Jul 4 2022 Liwei Ge - 7.4.19-3.0.1 +- Support loongarch64 platform + * Wed Jun 22 2022 Remi Collet - 7.4.19-3 - fix password of excessive length triggers buffer overflow leading to RCE CVE-2022-31626 -- Gitee