From f95429c946f30289a949ab5ded5dafb49c82311f Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Tue, 13 Apr 2010 19:20:11 +0000 Subject: [PATCH] Updating link to change in openSUSE:Factory/bash revision 55.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=8ed7935471b103440420a02662c0fabc --- bash-4.1-array.dif | 18 +++++ bash-4.1-intr.dif | 142 --------------------------------------- bash-4.1-patches.tar.bz2 | 4 +- bash.changes | 21 ++++++ bash.spec | 16 +++-- 5 files changed, 50 insertions(+), 151 deletions(-) create mode 100644 bash-4.1-array.dif diff --git a/bash-4.1-array.dif b/bash-4.1-array.dif new file mode 100644 index 00000000..6c5b3b8a --- /dev/null +++ b/bash-4.1-array.dif @@ -0,0 +1,18 @@ +Andreas Schwab writes: + +> $ declare -A a=b; unset a +> *** glibc detected *** /bin/bash: free(): invalid pointer: 0x10091644 *** + +And the obvious patch: + +--- builtins/declare.def ++++ builtins/declare.def 2010-04-09 17:20:51.000000000 +0000 +@@ -512,7 +512,7 @@ declare_internal (list, local_var) + { + /* let bind_{array,assoc}_variable take care of this. */ + if (assoc_p (var)) +- bind_assoc_variable (var, name, "0", value, aflags); ++ bind_assoc_variable (var, name, savestring ("0"), value, aflags); + else + bind_array_variable (name, 0, value, aflags); + } diff --git a/bash-4.1-intr.dif b/bash-4.1-intr.dif index 56ad467f..a9345d73 100644 --- a/bash-4.1-intr.dif +++ b/bash-4.1-intr.dif @@ -14,145 +14,3 @@ } #if 0 ---- xmalloc.c -+++ xmalloc.c 2010-02-24 08:32:51.452626384 +0000 -@@ -35,6 +35,11 @@ - # include "ansi_stdlib.h" - #endif /* HAVE_STDLIB_H */ - -+/* Determine which kind of system this is. */ -+#include -+extern int interrupt_immediately; -+extern int signal_is_trapped __P((int)); -+ - #include "error.h" - - #include "bashintl.h" -@@ -94,6 +99,34 @@ allocerr (func, bytes) - #endif /* !HAVE_SBRK */ - } - -+static void -+block_signals (setp, osetp) -+ sigset_t *setp, *osetp; -+{ -+#ifdef HAVE_POSIX_SIGNALS -+ sigfillset (setp); -+ sigemptyset (osetp); -+ sigprocmask (SIG_BLOCK, setp, osetp); -+#else -+# if defined (HAVE_BSD_SIGNALS) -+ *osetp = sigsetmask (-1); -+# endif -+#endif -+} -+ -+static void -+unblock_signals (setp, osetp) -+ sigset_t *setp, *osetp; -+{ -+#ifdef HAVE_POSIX_SIGNALS -+ sigprocmask (SIG_SETMASK, osetp, (sigset_t *)NULL); -+#else -+# if defined (HAVE_BSD_SIGNALS) -+ sigsetmask (*osetp); -+# endif -+#endif -+} -+ - /* Return a pointer to free()able block of memory large enough - to hold BYTES number of bytes. If the memory cannot be allocated, - print an error message and abort. */ -@@ -102,15 +135,28 @@ xmalloc (bytes) - size_t bytes; - { - PTR_T temp; -+ sigset_t set, oset; -+ int blocked_sigs; - - #if defined (DEBUG) - if (bytes == 0) - internal_warning("xmalloc: size argument is 0"); - #endif - -+ /* Block all signals in case we are executed from a signal handler. */ -+ blocked_sigs = 0; -+ if (interrupt_immediately || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD)) -+ { -+ block_signals (&set, &oset); -+ blocked_sigs = 1; -+ } -+ - FINDBRK(); - temp = malloc (bytes); - -+ if (blocked_sigs) -+ unblock_signals (&set, &oset); -+ - if (temp == 0) - allocerr ("xmalloc", bytes); - -@@ -123,15 +169,28 @@ xrealloc (pointer, bytes) - size_t bytes; - { - PTR_T temp; -+ sigset_t set, oset; -+ int blocked_sigs; - - #if defined (DEBUG) - if (bytes == 0) - internal_warning("xrealloc: size argument is 0"); - #endif - -+ /* Block all signals in case we are executed from a signal handler. */ -+ blocked_sigs = 0; -+ if (interrupt_immediately || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD)) -+ { -+ block_signals (&set, &oset); -+ blocked_sigs = 1; -+ } -+ - FINDBRK(); - temp = pointer ? realloc (pointer, bytes) : malloc (bytes); - -+ if (blocked_sigs) -+ unblock_signals (&set, &oset); -+ - if (temp == 0) - allocerr ("xrealloc", bytes); - -@@ -145,7 +204,22 @@ xfree (string) - PTR_T string; - { - if (string) -- free (string); -+ { -+ sigset_t set, oset; -+ int blocked_sigs = 0; -+ -+ /* Block all signals in case we are executed from a signal handler. */ -+ if (interrupt_immediately || signal_is_trapped (SIGINT) || signal_is_trapped (SIGCHLD)) -+ { -+ block_signals (&set, &oset); -+ blocked_sigs = 1; -+ } -+ -+ free (string); -+ -+ if (blocked_sigs) -+ unblock_signals (&set, &oset); -+ } - } - - #ifdef USING_BASH_MALLOC ---- builtins/read.def -+++ builtins/read.def 2010-03-02 16:24:59.070362886 +0000 -@@ -387,6 +387,8 @@ read_builtin (list) - input_string. We want to run all the rest and use input_string, - so we have to remove it from the stack. */ - remove_unwind_protect (); -+ interrupt_immediately--; -+ terminate_immediately = 0; - run_unwind_frame ("read_builtin"); - input_string[i] = '\0'; /* make sure it's terminated */ - retval = 128+SIGALRM; diff --git a/bash-4.1-patches.tar.bz2 b/bash-4.1-patches.tar.bz2 index 8d84f232..ffa48eb7 100644 --- a/bash-4.1-patches.tar.bz2 +++ b/bash-4.1-patches.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:04b5bbbf7fd0560da491e1a7610daea5ffc06a2df0b028fce25bd75d8d6c34e0 -size 1506 +oid sha256:73424968769484ed4ac52f07dbe882c9710faf8a348c0fffe57d64bbde8ad898 +size 2814 diff --git a/bash.changes b/bash.changes index a2119880..8a6fcdd5 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Mon Apr 12 11:36:30 CEST 2010 - werner@suse.de + +- Add fix for memory double free in array handling + +------------------------------------------------------------------- +Tue Apr 6 15:27:24 CEST 2010 - werner@suse.de + +- Update bash 4.1 to patch level 5 (related to bnc#522351) + * If command completion is attempted on a word with a quoted globbing + character (e.g., `*' or `?'), bash can reference a NULL pointer and + dump core. + * When running in Posix mode and executing a shell function without local + variables, bash will not propagate a variable in a special builtin's temporary + environment to have global scope. + * When the `read' builtin times out after the timeout specified with -t is + exceeded, it does not reset the flags that tell signal handlers to process + signals immediately instead of deferring their handling. This can result + in unsafe functions being called from signal handlers, which can cause bash + to hang or dump core. + ------------------------------------------------------------------- Tue Mar 9 15:34:05 CET 2010 - werner@suse.de diff --git a/bash.spec b/bash.spec index d8e925d8..39aa6520 100644 --- a/bash.spec +++ b/bash.spec @@ -28,7 +28,7 @@ Recommends: bash-lang = %bash_vers Suggests: command-not-found AutoReqProv: on Version: 4.1 -Release: 4 +Release: 5 Summary: The GNU Bourne-Again Shell Url: http://www.gnu.org/software/bash/bash.html Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{bash_vers}.tar.bz2 @@ -65,6 +65,7 @@ Patch30: readline-6.1-destdir.patch Patch40: bash-4.1-bash.bashrc.dif Patch41: bash-4.1-intr.dif Patch42: bash-4.1-non_void.patch +Patch43: bash-4.1-array.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _incdir %{_includedir} @@ -93,7 +94,7 @@ Group: Documentation/Man Provides: bash:%{_infodir}/bash.info.gz PreReq: %install_info_prereq Version: 4.1 -Release: 4 +Release: 5 AutoReqProv: on %if %suse_version > 1120 BuildArch: noarch @@ -116,7 +117,7 @@ License: GPLv2+ Summary: Include Files mandatory for Development of bash loadable builtins Group: Development/Languages/C and C++ Version: 4.1 -Release: 4 +Release: 5 AutoReqProv: on %description -n bash-devel @@ -136,7 +137,7 @@ License: GPLv2+ Summary: Loadable bash builtins Group: System/Shells Version: 4.1 -Release: 4 +Release: 5 AutoReqProv: on %description -n bash-loadables @@ -205,7 +206,7 @@ Summary: The Readline Library Group: System/Libraries Provides: bash:/%{_lib}/libreadline.so.%{rl_major} Version: 6.1 -Release: 4 +Release: 5 Recommends: readline-doc = %{version} # bug437293 %ifarch ppc64 @@ -234,7 +235,7 @@ Summary: Include Files and Libraries mandatory for Development Group: Development/Libraries/C and C++ Provides: bash:%{_libdir}/libreadline.a Version: 6.1 -Release: 4 +Release: 5 Requires: libreadline6 = %{version} Requires: ncurses-devel Recommends: readline-doc = %{version} @@ -263,7 +264,7 @@ Group: System/Libraries Provides: readline:%{_infodir}/readline.info.gz PreReq: %install_info_prereq Version: 6.1 -Release: 4 +Release: 5 AutoReqProv: on %if %suse_version > 1120 BuildArch: noarch @@ -310,6 +311,7 @@ unset p %patch40 -p0 -b .bashrc %patch41 -p0 -b .intr %patch42 -p0 -b .non_void +%patch43 -p0 -b .array %patch0 -p0 cd ../readline-%{rl_vers} for p in ../readline-%{rl_vers}-patches/*; do