Blame SOURCES/0556-Harden-dracut-against-BASH_ENV-environment-variable.patch

18971c
From fc87cf0e7e9790fb7c02ee54a73dd474ffa6fa38 Mon Sep 17 00:00:00 2001
18971c
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
18971c
Date: Thu, 7 Jun 2018 15:42:12 +0200
18971c
Subject: [PATCH] Harden dracut against BASH_ENV environment variable
18971c
MIME-Version: 1.0
18971c
Content-Type: text/plain; charset=UTF-8
18971c
Content-Transfer-Encoding: 8bit
18971c
18971c
When dracut silently produces a broken initramfs, then the system will
18971c
likely not boot and this can be very problematic. Typical use case is
18971c
after the kernel has been updated.
18971c
18971c
It appears that dracut is not protected against the BASH_ENV variable,
18971c
causing various scripts called by dracut to possibly fail or provide
18971c
wrong output (e.g. "ldd" is one of these).
18971c
Having a broken output for "ldd" makes the generated initramfs be not
18971c
usable, typically because vital binaries will be missing (e.g.
18971c
"awk", "udevadm", ...).
18971c
18971c
Note: because the shebang line cannot contain more than one argument,
18971c
the '--norc' option had to be removed. IMHO, it was useless anyway.
18971c
18971c
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
18971c
18971c
Cherry-picked from: c1c78f8a91921fe87f5672cdbdf9791f569fc8ac
18971c
Resolves: #1588483
18971c
---
18971c
 dracut.sh | 2 ++
18971c
 1 file changed, 2 insertions(+)
18971c
18971c
diff --git a/dracut.sh b/dracut.sh
18971c
index 52835872..27489528 100755
18971c
--- a/dracut.sh
18971c
+++ b/dracut.sh
18971c
@@ -23,6 +23,8 @@
18971c
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18971c
 #
18971c
 
18971c
+unset BASH_ENV
18971c
+
18971c
 # store for logging
18971c
 dracut_args=( "$@" )
18971c