]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut.sh: create the initramfs non-world readable also if early cpio is used
authorAndreas Stieger <astieger@suse.com>
Mon, 7 Nov 2016 09:37:22 +0000 (10:37 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 7 Nov 2016 09:41:38 +0000 (10:41 +0100)
Fixes: 5f2c30d9bcd614d546d5c55c6897e33f88b9ab90
Previously fixed CVE-2012-4453: e1b48995c26c4f06d1a718539cb1bd5b0179af91

Signed-off-by: Andreas Stieger <astieger@suse.com>
dracut.sh

index 40ca08f659f2289a608ac8e333d4cd818f8d7e76..2d79bbcc1e19ad69f01205767931110918e867c8 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1700,7 +1700,7 @@ if [[ $create_early_cpio = yes ]]; then
 
     # The microcode blob is _before_ the initramfs blob, not after
     if ! (
-            cd "$early_cpio_dir/d"
+            umask 077; cd "$early_cpio_dir/d"
             find . -print0 | sort -z \
                 | cpio ${CPIO_REPRODUCIBLE:+--reproducible} --null $cpio_owner_root -H newc -o --quiet > "${DRACUT_TMPDIR}/initramfs.img"
         ); then