diff options
author | Hongxu Jia <hongxu.jia@windriver.com> | 2017-08-18 03:31:51 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-18 12:35:56 +0100 |
commit | 4097694b13cd5f0d68987551c3f9af80c87dc6ae (patch) | |
tree | 856ea39cd724333d9fbbdfe76d73165edcd85877 /meta/recipes-extended/bash/bash | |
parent | f5c7e236582028638a26a5855d5e7ba0b55bb8f0 (diff) | |
download | openembedded-core-contrib-4097694b13cd5f0d68987551c3f9af80c87dc6ae.tar.gz |
bash: 4.3.30 -> 4.4
1. Rebase patches:
- fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch
- test-output.patch
2. Drop backported patches:
- CVE-2016-9401.patch
- fix-run-intl.patch
3. Add ${PN}-loadable for loadable builtins which is new features in Bash 4.4
4. The 4.4 fixed CVE-2017-5932 and CVE-2016-0634
- https://security-tracker.debian.org/tracker/CVE-2017-5932
- https://security-tracker.debian.org/tracker/CVE-2016-0634
5. The 4.4 installed include header files, fix bash-dev confilicts
with lib32-bash-dev
.....
$ bitbake lib32-core-image-sato-sdk
...
|Error: Transaction check error: file /usr/include/bash/config.h
conflicts between attempted installs
|of lib32-bash-dev-4.4-r0.x86 and bash-dev-4.4-r0.core2_64
......
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/bash/bash')
4 files changed, 49 insertions, 316 deletions
diff --git a/meta/recipes-extended/bash/bash/CVE-2016-9401.patch b/meta/recipes-extended/bash/bash/CVE-2016-9401.patch deleted file mode 100644 index 28c927743c..0000000000 --- a/meta/recipes-extended/bash/bash/CVE-2016-9401.patch +++ /dev/null @@ -1,50 +0,0 @@ -From fa741771ed47b30547be63b5b5dbfb51977aca12 Mon Sep 17 00:00:00 2001 -From: Chet Ramey <chet.ramey@case.edu> -Date: Fri, 20 Jan 2017 11:47:31 -0500 -Subject: [PATCH] Bash-4.4 patch 6 - -Bug-Reference-URL: -https://lists.gnu.org/archive/html/bug-bash/2016-11/msg00116.html - -Reference to upstream patch: -https://ftp.gnu.org/pub/gnu/bash/bash-4.4-patches/bash44-006 - -Bug-Description: -Out-of-range negative offsets to popd can cause the shell to crash attempting -to free an invalid memory block. - -Upstream-Status: Backport -CVE: CVE-2016-9401 -Signed-off-by: Li Zhou <li.zhou@windriver.com> ---- - builtins/pushd.def | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/builtins/pushd.def b/builtins/pushd.def -index 9c6548f..8a13bae 100644 ---- a/builtins/pushd.def -+++ b/builtins/pushd.def -@@ -359,7 +359,7 @@ popd_builtin (list) - break; - } - -- if (which > directory_list_offset || (directory_list_offset == 0 && which == 0)) -+ if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0)) - { - pushd_error (directory_list_offset, which_word ? which_word : ""); - return (EXECUTION_FAILURE); -@@ -381,6 +381,11 @@ popd_builtin (list) - remove that directory from the list and shift the remainder - of the list into place. */ - i = (direction == '+') ? directory_list_offset - which : which; -+ if (i < 0 || i > directory_list_offset) -+ { -+ pushd_error (directory_list_offset, which_word ? which_word : ""); -+ return (EXECUTION_FAILURE); -+ } - free (pushd_directory_list[i]); - directory_list_offset--; - --- -1.9.1 - diff --git a/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch b/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch index 7f099ae0c6..9ac2461ab6 100644 --- a/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch +++ b/meta/recipes-extended/bash/bash/fix-run-coproc-run-heredoc-run-execscript-run-test-f.patch @@ -1,15 +1,7 @@ -From 2c30dff8ea8b17ad5ba9881e35ad1eba9c515f13 Mon Sep 17 00:00:00 2001 +From d1cd4c31ea0ed7406a3ad4bdaa211f581063f655 Mon Sep 17 00:00:00 2001 From: Hongxu Jia <hongxu.jia@windriver.com> -Date: Thu, 26 Nov 2015 22:09:07 -0500 -Subject: [PATCH] fix run-coproc/run-heredoc/run-execscript/run-test/ failed - -FAIL: run-coproc -update test case:tests/coproc.right, tests/coproc.tests -git://git.sv.gnu.org/bash.git bash-4.4-testing - -FAIL: run-heredoc -update test case: tests/heredoc.right tests/heredoc3.sub -git://git.sv.gnu.org/bash.git bash-4.4-testing +Date: Tue, 15 Aug 2017 10:21:21 +0800 +Subject: [PATCH 2/2] fix run-execscript/run-test/ failed FAIL: run-execscript: the test suite should not be run as root @@ -21,149 +13,33 @@ Upstream-Status: Pending Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- - tests/coproc.right | 5 +---- - tests/coproc.tests | 30 +++++++++++++++++++++++++----- - tests/heredoc.right | 5 ++--- - tests/heredoc3.sub | 3 ++- - tests/run-execscript | 3 ++- - tests/run-test | 3 ++- - 6 files changed, 34 insertions(+), 15 deletions(-) + tests/run-execscript | 3 ++- + tests/run-test | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) -diff --git a/tests/coproc.right b/tests/coproc.right -index 6d9deaa..94b001c 100644 ---- a/tests/coproc.right -+++ b/tests/coproc.right -@@ -1,11 +1,8 @@ --84575 - 63 60 - a b c --84577 - 63 60 - flop --./coproc.tests: line 22: 84577 Terminated coproc REFLECT { cat -; } --84579 -+coproc.tests: REFLECT: status 143 - 63 60 - FOO - 63 60 -diff --git a/tests/coproc.tests b/tests/coproc.tests -index 8be3563..d347eb7 100644 ---- a/tests/coproc.tests -+++ b/tests/coproc.tests -@@ -1,6 +1,13 @@ -+: ${TMPDIR:=/tmp} -+TMPOUT=${TMPDIR}/coproc-wait-$BASHPID -+ - coproc { echo a b c; sleep 2; } - --echo $COPROC_PID -+case $COPROC_PID in -+[0-9]*) ;; -+*) echo COPROC_PID not integer ;; -+esac -+ - echo ${COPROC[@]} - - read LINE <&${COPROC[0]} -@@ -10,7 +17,11 @@ wait $COPROC_PID - - coproc REFLECT { cat - ; } - --echo $REFLECT_PID -+case $REFLECT_PID in -+[0-9]*) ;; -+*) echo REFLECT_PID not integer ;; -+esac -+ - echo ${REFLECT[@]} - - echo flop >&${REFLECT[1]} -@@ -18,12 +29,21 @@ read LINE <&${REFLECT[0]} - - echo $LINE - --kill $REFLECT_PID --wait $REFLECT_PID -+{ sleep 1; kill $REFLECT_PID; } & -+wait $REFLECT_PID >$TMPOUT 2>&1 || echo "coproc.tests: REFLECT: status $?" -+grep 'Terminated.*coproc.*REFLECT' < $TMPOUT >/dev/null 2>&1 || { -+ echo "coproc.tests: wait for REFLECT failed" >&2 -+} -+rm -f $TMPOUT -+exec 2>&1 - - coproc xcase -n -u - --echo $COPROC_PID -+case $COPROC_PID in -+[0-9]*) ;; -+*) echo COPROC_PID not integer ;; -+esac -+ - echo ${COPROC[@]} - - echo foo >&${COPROC[1]} -diff --git a/tests/heredoc.right b/tests/heredoc.right -index 6abaa1f..8df91c5 100644 ---- a/tests/heredoc.right -+++ b/tests/heredoc.right -@@ -76,15 +76,14 @@ ENDEND - end ENDEND - hello - end hello --x star x - end x*x - helloEND - end helloEND - hello - \END - end hello<NL>\END --./heredoc3.sub: line 74: warning: here-document at line 72 delimited by end-of-file (wanted `EOF') --./heredoc3.sub: line 75: syntax error: unexpected end of file -+./heredoc3.sub: line 75: warning: here-document at line 73 delimited by end-of-file (wanted `EOF') -+./heredoc3.sub: line 76: syntax error: unexpected end of file - comsub here-string - ./heredoc.tests: line 105: warning: here-document at line 103 delimited by end-of-file (wanted `EOF') - hi -diff --git a/tests/heredoc3.sub b/tests/heredoc3.sub -index 73a111e..9d3d846 100644 ---- a/tests/heredoc3.sub -+++ b/tests/heredoc3.sub -@@ -49,9 +49,10 @@ hello - END - echo end hello - --cat <<x*x & touch 'x*x' -+cat <<x*x >/dev/null & touch 'x*x' - x star x - x*x -+wait $! - echo end 'x*x' - rm 'x*x' - diff --git a/tests/run-execscript b/tests/run-execscript -index f97ab21..0d00a1b 100644 +index de78644..38397c1 100644 --- a/tests/run-execscript +++ b/tests/run-execscript @@ -5,5 +5,6 @@ echo "warning: \`/tmp/bash-notthere' not being found or \`/' being a directory" echo "warning: produce diff output, please do not consider this a test failure" >&2 echo "warning: if diff output differing only in the location of the bash" >&2 echo "warning: binary appears, please do not consider this a test failure" >&2 --${THIS_SH} ./execscript > /tmp/xx 2>&1 -+rm -f /tmp/xx -+su -c "${THIS_SH} ./execscript > /tmp/xx 2>&1" test - diff /tmp/xx exec.right && rm -f /tmp/xx +-${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1 ++rm -f ${BASH_TSTOUT} ++su -c "${THIS_SH} ./execscript > ${BASH_TSTOUT} 2>&1" test + diff ${BASH_TSTOUT} exec.right && rm -f ${BASH_TSTOUT} diff --git a/tests/run-test b/tests/run-test -index b2482c3..2e8f049 100644 +index d68791c..d6317d2 100644 --- a/tests/run-test +++ b/tests/run-test @@ -1,4 +1,5 @@ unset GROUPS UID 2>/dev/null --${THIS_SH} ./test.tests >/tmp/xx 2>&1 -+rm -f /tmp/xx -+su -c "${THIS_SH} ./test.tests >/tmp/xx 2>&1" test - diff /tmp/xx test.right && rm -f /tmp/xx +-${THIS_SH} ./test.tests >${BASH_TSTOUT} 2>&1 ++rm -f ${BASH_TSTOUT} ++su -c "${THIS_SH} ./test.tests > ${BASH_TSTOUT} 2>&1" test + diff ${BASH_TSTOUT} test.right && rm -f ${BASH_TSTOUT} -- -1.9.1 +1.8.3.1 diff --git a/meta/recipes-extended/bash/bash/fix-run-intl.patch b/meta/recipes-extended/bash/bash/fix-run-intl.patch deleted file mode 100644 index d4a3409ec6..0000000000 --- a/meta/recipes-extended/bash/bash/fix-run-intl.patch +++ /dev/null @@ -1,110 +0,0 @@ -From a00d3161fd7b6a698bdd2ed5f0ac5faac580ee2a Mon Sep 17 00:00:00 2001 -From: Dengke Du <dengke.du@windriver.com> -Date: Wed, 3 Aug 2016 23:13:00 -0400 -Subject: [PATCH] fix run-intl failed - -1. Filter extra white space of intl.right - - Due to the extra white space of intl.right, when the result of - sub-test unicode2.sub of intl.tests compared to it, the test - failed. - - So we need to filter the extra white space of intl.right. - - Import this patch for intl.right from bash devel branch: - - http://git.savannah.gnu.org/cgit/bash.git/log/?h=devel - - commit is: - - 85ec0778f9d778e1820fb8c0e3e996f2d1103b45 - -2. Change intl.right correspond to the unicode3.sub's output - - In sub-test unicode3.sub of intl.tests, the payload value is: - - payload=$'\065\247\100\063\231\053\306\123\070\237\242\352\263' - - It used quoted string expansion(escaped octal) to assign ASCII - characters to variables. So when the test run the following: - - printf %q "$payload" - - It produced: - - $'5\247@3\231+\306S8\237\242\352\263' - - When compared to the intl.right(contain the converted character), it failed. - - Import parts of patch for intl.right from bash devel branch: - - http://git.savannah.gnu.org/cgit/bash.git/log/?h=devel - - commit is: - - 74b8cbb41398b4453d8ba04d0cdd1b25f9dcb9e3 - -Upstream-Status: Backport - -Signed-off-by: Dengke Du <dengke.du@windriver.com> ---- - tests/intl.right | 30 +++++++++++++++--------------- - 1 file changed, 15 insertions(+), 15 deletions(-) - -diff --git a/tests/intl.right b/tests/intl.right -index acf108a..1efdfbe 100644 ---- a/tests/intl.right -+++ b/tests/intl.right -@@ -18,34 +18,34 @@ aéb - 1.0000 - 1,0000 - Passed all 1378 Unicode tests --0000000 303 277 012 -+0000000 303 277 012 - 0000003 --0000000 303 277 012 -+0000000 303 277 012 - 0000003 --0000000 303 277 012 -+0000000 303 277 012 - 0000003 --0000000 303 277 012 -+0000000 303 277 012 - 0000003 --0000000 357 277 277 012 -+0000000 357 277 277 012 - 0000004 --0000000 357 277 277 012 -+0000000 357 277 277 012 - 0000004 --0000000 012 -+0000000 012 - 0000001 --0000000 012 -+0000000 012 - 0000001 --0000000 012 -+0000000 012 - 0000001 --0000000 012 -+0000000 012 - 0000001 --0000000 303 277 012 -+0000000 303 277 012 - 0000003 --0000000 303 277 012 -+0000000 303 277 012 - 0000003 --0000000 303 277 012 -+0000000 303 277 012 - 0000003 --0000000 101 040 302 243 040 305 222 012 -+0000000 101 040 302 243 040 305 222 012 - 0000010 - ./unicode3.sub: line 2: 5§@3™+ÆS8Ÿ¢ê³: command not found --5§@3™+ÆS8Ÿ¢ê³ -+$'5\247@3\231+\306S8\237\242\352\263' - + : $'5\247@3\231+\306S8\237\242\352\263' --- -2.8.1 - diff --git a/meta/recipes-extended/bash/bash/test-output.patch b/meta/recipes-extended/bash/bash/test-output.patch index 2b09b7d977..0ffcc24587 100644 --- a/meta/recipes-extended/bash/bash/test-output.patch +++ b/meta/recipes-extended/bash/bash/test-output.patch @@ -1,25 +1,42 @@ -Add FAIL/PASS output to test output. +From 28eb06047ebd2deaa8c7cd2bf6655ef6a469dc14 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Tue, 15 Aug 2017 10:01:56 +0800 +Subject: [PATCH 1/2] Add FAIL/PASS output to test output. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Signed-off-by: Björn Stenberg <bjst@enea.com> Upstream-Status: Pending + +Rebase to 4.4 +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> --- -diff -uNr a/tests/run-all b/tests/run-all ---- a/tests/run-all 1999-10-08 17:07:46.000000000 +0200 -+++ b/tests/run-all 2012-10-27 21:04:18.663331887 +0200 -@@ -22,7 +22,15 @@ + tests/run-all | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/tests/run-all b/tests/run-all +index 2882fe0..e21d026 100644 +--- a/tests/run-all ++++ b/tests/run-all +@@ -33,7 +33,16 @@ do case $x in $0|run-minimal|run-gprof) ;; *.orig|*~) ;; -- *) echo $x ; sh $x ;; -+ *) echo $x -+ output=`sh $x` -+ if [ -n "$output" ]; then -+ echo "$output" -+ echo "FAIL: $x" -+ else -+ echo "PASS: $x" -+ fi -+ ;; +- *) echo $x ; sh $x ; rm -f ${BASH_TSTOUT} ;; ++ *) echo $x ++ output=`sh $x` ++ if [ -n "$output" ]; then ++ echo "$output" ++ echo "FAIL: $x" ++ else ++ echo "PASS: $x" ++ fi ++ rm -f ${BASH_TSTOUT} ++ ;; esac done +-- +1.8.3.1 + |