From 780601c43d21b9e7148971e072da11bbf1944bb6 Mon Sep 17 00:00:00 2001 From: wangyuhang27 Date: Thu, 10 Nov 2022 09:55:19 +0800 Subject: [PATCH] fix CVE-2022-3715 --- backport-fix-CVE-2022-3715.patch | 27 +++++++++++++++++++++++++++ bash.spec | 9 ++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 backport-fix-CVE-2022-3715.patch diff --git a/backport-fix-CVE-2022-3715.patch b/backport-fix-CVE-2022-3715.patch new file mode 100644 index 0000000..0634bc3 --- /dev/null +++ b/backport-fix-CVE-2022-3715.patch @@ -0,0 +1,27 @@ +From 9cef6d01181525de119832d2b6a925899cdec08e Mon Sep 17 00:00:00 2001 +From: Chet Ramey +Date: Fri, 9 Sep 2022 16:44:32 -0400 +Subject: [PATCH] Bash-5.2-rc4 release + +Conflict:backport partial patch to fix CVE-2022-3715 +Reference:https://git.savannah.gnu.org/cgit/bash.git/commit/?id=9cef6d01181525de119832d2b6a925899cdec08e +--- + subst.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/subst.c b/subst.c +index 677eeed..8fd03f3 100644 +--- a/subst.c ++++ b/subst.c +@@ -7959,7 +7959,7 @@ parameter_brace_transform (varname, value, ind, xform, rtype, quoted, pflags, fl + return ((char *)NULL); + } + +- if (valid_parameter_transform (xform) == 0) ++ if (xform[0] == 0 || valid_parameter_transform (xform) == 0) + { + this_command_name = oname; + #if 0 /* TAG: bash-5.2 Martin Schulte 10/2020 */ +-- +2.33.0 + diff --git a/bash.spec b/bash.spec index 3be28f3..9dea1e6 100644 --- a/bash.spec +++ b/bash.spec @@ -1,6 +1,6 @@ Name: bash Version: 5.1.8 -Release: 5 +Release: 6 Summary: It is the Bourne Again Shell License: GPLv3 URL: https://www.gnu.org/software/bash @@ -25,6 +25,7 @@ Patch138: enable-dot-logout-and-source-bashrc-through-ssh.patch Patch139: cd-alias.patch Patch140: bash-5.1-sw.patch Patch141: backport-fix-crash-in-readline-when-started-with-an-invalid.patch +Patch142: backport-fix-CVE-2022-3715.patch BuildRequires: gcc bison texinfo autoconf ncurses-devel # Required for bash tests @@ -118,6 +119,12 @@ make check %exclude %{_infodir}/dir %changelog +* Thu Nov 10 2022 wangyuhang -5.1.8-6 +- Type:CVE +- ID:NA +- SUG:NA +- DESC: fix CVE-2022-3715 + * Sat Oct 29 2022 licihua -5.1.8-5 - Type:enhancement - ID:NA -- Gitee