From 87567e53cc1009be4e9c6f813a0968a3b17db538 Mon Sep 17 00:00:00 2001 From: Zhao Mengmeng Date: Mon, 3 Jun 2024 17:21:19 +0800 Subject: [PATCH] Fix a performance regression while using large number of environment variables Resolves: RHEL-20020 Signed-off-by: Siteshwar Vashisht Signed-off-by: Zhao Mengmeng (cherry picked from commit 2e83188621b042cb157604e9d457bec450062d82) --- ...e-regression-while-using-large-numbe.patch | 31 +++++++++++++++++++ bash.spec | 9 +++++- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 backport-Fix-a-performance-regression-while-using-large-numbe.patch diff --git a/backport-Fix-a-performance-regression-while-using-large-numbe.patch b/backport-Fix-a-performance-regression-while-using-large-numbe.patch new file mode 100644 index 0000000..2e9d025 --- /dev/null +++ b/backport-Fix-a-performance-regression-while-using-large-numbe.patch @@ -0,0 +1,31 @@ +From b1764f8226260d5b58958d613c7654f01e624dca Mon Sep 17 00:00:00 2001 +From: Zhao Mengmeng +Date: Mon, 3 Jun 2024 16:49:46 +0800 +Subject: [PATCH] Fix a performance regression while using large number of + environment variables + +Resolves: RHEL-20020 +Signed-off-by: Siteshwar Vashisht +--- + execute_cmd.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/execute_cmd.c b/execute_cmd.c +index 71d147c..2e33722 100644 +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -5482,11 +5482,7 @@ execute_disk_command (words, redirects, command_line, pipe_in, pipe_out, + { + /* If we're optimizing out the fork (implicit `exec'), decrement the + shell level like `exec' would do. */ +-#if 0 /* TAG: bash-5.2 psmith 10/11/2020 */ + if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE && (subshell_environment & SUBSHELL_PIPE) == 0) +-#else +- if (nofork && pipe_in == NO_PIPE && pipe_out == NO_PIPE) +-#endif + adjust_shell_level (-1); + + maybe_make_export_env (); +-- +2.33.0 + diff --git a/bash.spec b/bash.spec index 5fd1657..6f14c92 100644 --- a/bash.spec +++ b/bash.spec @@ -1,6 +1,6 @@ Name: bash Version: 5.1.8 -Release: 14 +Release: 15 Summary: It is the Bourne Again Shell License: GPLv3 URL: https://www.gnu.org/software/bash @@ -45,6 +45,7 @@ Patch6014: backport-fixes-for-LINENO-in-multi-line-simple-commands-print.patch Patch6015: backport-changes-to-SIGINT-handler-while-waiting-for-a-child-.patch Patch6016: backport-renamed-several-functions-beginning-with-legal_-chan.patch Patch6017: backport-fix-for-cd-when-curent-directory-doesn-t-exist-fix-w.patch +Patch6018: backport-Fix-a-performance-regression-while-using-large-numbe.patch BuildRequires: gcc bison texinfo autoconf ncurses-devel # Required for bash tests @@ -138,6 +139,12 @@ make check %exclude %{_infodir}/dir %changelog +* Mon Jun 03 2024 Zhao Mengmeng - 5.1.8-15 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC: Fix a performance regression while using large number of environment variables + * Fri Mar 29 2024 wangyuhang - 5.1.8-14 - fix some overflows in printf -- Gitee