grub2/grub-core
Eric Biggers 2cbde6e54e Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature.
On such a filesystem, inodes may have EXT4_ENCRYPT_FLAG set.
For a regular file, this means its contents are encrypted; for a
directory, this means the filenames in its directory entries are
encrypted; and for a symlink, this means its target is encrypted.  Since
GRUB cannot decrypt encrypted contents or filenames, just issue an error
if it would need to do so.  This is sufficient to allow unencrypted boot
files to co-exist with encrypted files elsewhere on the filesystem.

(Note that encrypted regular files and symlinks will not normally be
encountered outside an encrypted directory; however, it's possible via
hard links, so they still need to be handled.)

Tested by booting from an ext4 /boot partition on which I had run
'tune2fs -O encrypt'.  I also verified that the expected error messages
are printed when trying to access encrypted directories, files, and
symlinks from the GRUB command line.  Also ran 'sudo ./grub-fs-tester
ext4_encrypt'; note that this requires e2fsprogs v1.43+ and Linux v4.1+.

Signed-off-by: Eric Biggers <ebiggers@google.com>

Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=734668238fcc0ef691a080839e04f33854fa133a
Bug-Debian: https://bugs.debian.org/840204
Last-Update: 2017-07-06

Patch-Name: ext4_feature_encrypt.patch
2017-07-06 17:56:23 +01:00
..
boot Add configure option to reduce visual clutter at boot time 2017-06-23 10:07:57 +01:00
bus usbtrans: Fix memory coherence and use-after-free. 2016-02-27 13:40:52 +01:00
commands Add configure option to enable gfxpayload=keep dynamically 2017-06-23 10:07:57 +01:00
disk i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
efiemu i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
font Document intentional fallthroughs. 2015-01-27 17:17:58 +01:00
fs Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature. 2017-07-06 17:56:23 +01:00
gdb i386, x86_64, ppc: fix switch fallthrough cases with GCC7 2017-04-04 19:23:55 +03:00
gettext Silence error messages when translations are unavailable 2017-06-23 10:07:55 +01:00
gfxmenu gfxmenu: fix memory leak 2016-01-12 21:52:50 +03:00
gnulib Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
hello * grub-core/commands/gptsync.c: Fix typographic quoting. 2012-03-03 13:05:08 +01:00
hook * grub-core/hook/datehook.c (grub_read_hook_datetime): Small stylistic 2011-11-11 21:03:49 +01:00
io gzio: Optimize by removing division. 2015-02-26 22:10:09 +01:00
kern misc: fix invalid character recongition in strto*l 2017-06-23 11:35:06 +01:00
lib Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
loader If running under UEFI secure boot, attempt to use linuxefi loader 2017-06-23 10:07:57 +01:00
mmap Translate UEFI persistent memory type 2015-12-15 10:25:34 +03:00
net efinet: Setting DNS server from UEFI protocol 2017-06-23 11:35:06 +01:00
normal Add configure option to bypass boot menu if possible 2017-06-23 10:07:57 +01:00
osdep Make grub-install check for errors from efibootmgr 2017-06-23 11:35:07 +01:00
partmap disk/ldm, partmap/msdos.c: fix spelling error 2015-08-22 21:22:41 +02:00
parttool * grub-core/net/http.c: Add TRANSLATORS comments. 2012-03-05 16:42:26 +01:00
script script: fix double free in lexer 2017-02-12 09:23:34 +03:00
term Include a text attribute reset in the clear command for ppc 2017-06-23 10:07:58 +01:00
tests Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
video Blacklist 1440x900x32 from VBE preferred mode handling 2017-06-23 10:07:56 +01:00
gdb_grub.in * grub-core/gdb_grub.in: Fix overflow and wrong field. 2013-10-14 03:40:20 +02:00
genemuinit.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genemuinitheader.sh use MODULE_FILES for genemuinit* instead of MOD_FILES 2014-01-18 23:15:40 +04:00
genmod.sh.in grub-module-verifier: Ignore all_video emptiness on xen. 2017-01-30 00:13:41 +00:00
genmoddep.awk genmoddep.awk: Add a test that we have no circular dependencies 2015-11-08 20:00:27 +01:00
gensyminfo.sh.in * grub-core/gensyminfo.sh.in: Handle the case of portable output 2013-11-11 23:05:53 +01:00
gensymlist.sh Make 'make check' work on emu. 2013-04-27 02:00:16 +02:00
gentrigtables.c * grub-core/gentrigtables.c: Make tables const. 2013-03-01 11:15:09 +01:00
gmodule.pl.in * grub-core/gmodule.pl.in: Accept newer binutils which output 2014-09-21 18:23:23 +02:00
gnulib-fix-null-deref.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
gnulib-fix-width.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
gnulib-no-abort.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
gnulib-no-gets.diff Import new gnulib. 2013-04-11 21:12:46 +02:00
Makefile.am Split pmtimer wait and tsc measurement from pmtimer tsc calibration. 2016-02-12 11:40:51 +01:00
Makefile.core.am Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
Makefile.core.def Add configure option to enable gfxpayload=keep dynamically 2017-06-23 10:07:57 +01:00
Makefile.gcry.def Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
Makefile.in Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
modinfo.sh.in modinfo.sh.in: Add missing config variables. 2015-03-27 12:18:25 +01:00
unidata.c Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00