Bug 1211538

Summary: Bash fix for CVE-2014-7169 breaks ksh scripts that try to clear the environment
Product: Red Hat Enterprise Linux 7 Reporter: Martin Kyral <mkyral>
Component: kshAssignee: Siteshwar Vashisht <svashisht>
Status: CLOSED ERRATA QA Contact: Martin Kyral <mkyral>
Severity: unspecified Docs Contact:
Priority: urgent    
Version: 7.1CC: cww, dkutalek, dsulliva, eblake, fkrska, fweimer, henk, isenfeld, jkejda, jonstanley, kazen, kdudka, mhlavink, mkyral, ovasik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: ksh-20120801-26.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1147645 Environment:
Last Closed: 2016-11-04 07:45:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1147645    
Bug Blocks: 1203710, 1295396, 1295829, 1313485    

Description Martin Kyral 2015-04-14 09:26:19 UTC
+++ This bug was initially created as a clone of Bug #1147645 +++

Description of problem:
ksh scripts that try to unset the BASH_FUNC_*() variables fail.

Version-Release number of selected component (if applicable):
ksh-20120801-22.el7

How reproducible:
100%

Steps to Reproduce:
[user@hose ~]$ a() { 
> echo test
> }
[user@host ~]$ set | fgrep BASH_FUNC
[user@host ~]$ export -f a
[user@host ~]$ ksh
$ set | fgrep BASH_FUNC
BASH_FUNC_a()=$'() {  echo test\n}'
BASH_FUNC_module()=$'() {  eval `/usr/bin/modulecmd bash $*`\n}'
$ 

This might not be an issue, except if you try to unset it to clean up your environment:

$ unset 'BASH_FUNC_a()'
ksh: unset: BASH_FUNC_a(): invalid variable name
$ 


Actual results:
If perhaps you are being careful and use 'set -e' the entire script dies causing significant issues...

Expected results:
ksh should be able to clear it's environment...

Additional info:
'man ksh' describes that metacharacters are not valid in variable names:
 ;   &   (   )   |   <   >   new-line   space   tab

The upstream bash fix is using %% for the fix (perhaps for this reason?)...
http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-027

Comment 6 errata-xmlrpc 2016-11-04 07:45:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2510.html