Commit Graph

9 Commits

Author SHA1 Message Date
Zhang Xiao 08f8bf817b bash: memleak bug fix for builtin command read
Built in command "read" with "-e" use Readline to obtain the line
in an interactive shell. In this process, a string "rlbuf" is
just allocated without free operation thus cause memory leak.

This patch had been submitted to upstream:
http://lists.gnu.org/archive/html/bug-bash/2017-02/msg00061.html

(From OE-Core rev: a2b278a6eaa9e9b48d858e3be6712267c0122598)

(From OE-Core rev: 571e53024b4f924e50cf6a478ccc8d6f097816bb)

Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
fixup for 4.3
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 22:15:59 +01:00
Zhixiong Chi e5aa1ac236 bash: CVE-2016-0634
A vulnerability was found in a way bash expands the $HOSTNAME.
Injecting the hostname with malicious code would cause it to run
each time bash expanded \h in the prompt string.

Porting patch from <https://ftp.gnu.org/gnu/bash/bash-4.3-patches/
bash43-047> to solve CVE-2016-0634

CVE: CVE-2016-0634

(From OE-Core rev: 7dd6aa1a4bf6e9fc8a1998cda6ac5397bb5cd5cb)

(From OE-Core rev: a4b37b05140b549960baef49237ce3316e84a041)

Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-18 13:17:44 +01:00
Li Zhou 1b2857a781 bash: fix CVE-2016-9401
popd in bash might allow local users to bypass the restricted shell
and cause a use-after-free via a crafted address.

Porting patch from <https://ftp.gnu.org/pub/gnu/bash/bash-4.4-patches/
bash44-006> to solve CVE-2016-9401.

(From OE-Core rev: 6987b317d5ce8dc50a37ebba395aa8424bec358c)

Signed-off-by: Li Zhou <li.zhou@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-15 20:06:44 -08:00
Dengke Du ddaf84ce86 bash: fix run-intl ptest failed
1. Filter the extra white space in intl.right

   When the sub-test unicode2.sub of intl.tests executed, it produced
   compact results without extra white space, compared to intl.right,
   it failed.

   So we need to filter the extra white space in 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 have this:

		printf %q "$payload"

   The payload variable was assigned by ASCII characters, when using
   '%q' format strings, it means print the associated argument shell-quoted.

   When the strings contain the non-alpha && non-digit && non-punctuation &&
   non-ISO 646 character(7-bit), it would output like this: " $'...', ANSI-C
   style quoted string. We can check the bash source code at:

	http://git.savannah.gnu.org/cgit/bash.git/tree/builtins/printf.def#n557
	http://git.savannah.gnu.org/cgit/bash.git/tree/lib/sh/strtrans.c#n331

   So we need to change the intl.right contain the correct output of unicode3.sub.

   Import parts of this patch for intl.right from bash devel branch:

	http://git.savannah.gnu.org/cgit/bash.git/log/?h=devel

   Commit is:

	74b8cbb41398b4453d8ba04d0cdd1b25f9dcb9e3

3. Add the sanity check for locales

   When run the intl.tests, we need the following locales:

	en_US & fr_FR & de_DE

   So add the locales check for the intl.tests in run-ptest.

(From OE-Core rev: 640676226bb351420a0a8b2d2a3c120ae42da11e)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-23 17:44:38 +01:00
Dengke Du 2973bc2b29 bash: 4.3.39 -> 4.3.46
(From OE-Core rev: 2e12615ca5ab4acf7ec2952b7555054ca88e147d)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 09:27:53 +01:00
André Draszik 0152d75a6e bash: add patch to build w/ -Wformat-security
(From OE-Core rev: 45bc8a2c4bbe252526d5eee2547f8b9e06165e5a)

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-01 11:47:11 +01:00
Dengke Du 9563869995 bash: fixed ptest run-builtins failed
1. redirect the stderr output of the command exec with -l option to
   /dev/null.
   Because when we run command exec with -l option in builtins.tests,
   it is a login shell, so it would read the file /etc/profile, that
   file executes the /usr/bin/resize which added by commit:
	 cc6360f4c4d97e0000f9d3545f381224ee99ce7d
   The /usr/bin/resize is produced by busybox that source code resize.c
   contains:
	fprintf(stderr, ESC"7" ESC"[r" ESC"[999;999H" ESC"[6n");
   In the end, it outputs an escape sequence to the stderr, so when we
   compare the test output file /tmp/xx with builtins.right, it failed.
   we need to redirect the stderr output to the /dev/null to solve the
   problem.

2. ensure the target system contains the locales "en_US.UTF-8".
   Because when run the run-builtins, it executes the source5.sub file
   that contain:
	LC_ALL=en_US.UTF-8
   such as add the following to the local.conf:
	IMAGE_LINGUAS_append = " en-us"

(From OE-Core rev: 5f82f3df7d4a7d6ae9a1ea3b6bc1d620a3d6c329)

Signed-off-by: Dengke Du <dengke.du@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:58:43 +01:00
Hongxu Jia a74258671f bash: fix testcase run-coproc/run-execscript/run-test/run-heredoc failed
Add user 'test' to fix the failure of 'the test suite should not
be run as root'(run-execscript and run-test)

Backport test case from git://git.sv.gnu.org/bash.git to fix run-execscript
and run-heredoc

Still failed cases:
FAIL: run-intl
FAIL: run-lastpipe
FAIL: run-trap

YOCTO: 5698

(From OE-Core rev: 1096140cb1d2532ecb38ac5fbbbe13d40fdaf6af)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-12 23:42:53 +00:00
Robert Yang 44bbb402af bash: 4.3 -> 4.3.30
Remove patch001 -> patch030 since they are already in source, add
patch031 -> patch039

(From OE-Core rev: 781ec1061306f43265f9d756a89d1b86bd5d19a0)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-10 12:40:21 -07:00