Go to file
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
asm-tests asm-tests/i386-pc: Check that movl is 5 bytes. 2016-09-28 20:31:04 +03:00
build-aux Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
conf Remove -Wno-maybe-uninitialized as it may not be present. 2016-02-17 17:58:05 +01:00
docs Add GRUB_RECOVERY_TITLE option 2017-06-23 10:07:57 +01:00
grub-core Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature. 2017-07-06 17:56:23 +01:00
include Make grub-install check for errors from efibootmgr 2017-06-23 11:35:07 +01:00
m4 update m4/extern-inline.m4 to upstream version to fix compilation on FreeBSD 2015-03-05 19:25:56 +03:00
po Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
tests Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature. 2017-07-06 17:56:23 +01:00
themes/starfield Starfield theme. 2012-02-23 17:21:38 +01:00
unicode * unicode: Import Unicode 6.0 data. 2011-12-25 16:17:25 +01:00
util Make grub-install check for errors from efibootmgr 2017-06-23 11:35:07 +01:00
ABOUT-NLS automake commit without merge history 2010-05-06 11:34:04 +05:30
acinclude.m4 Fix -nopie/-nopie check. 2017-01-30 19:38:55 +01:00
aclocal.m4 Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
AUTHORS 2005-09-03 Yoshinori K. Okuji <okuji@enbug.org> 2005-09-03 16:54:27 +00:00
autogen.sh autogen: Use cp instead of ln -s. 2015-11-08 18:45:57 +01:00
BUGS * BUGS: New file. 2011-01-11 00:06:01 +01:00
ChangeLog Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
ChangeLog-2015 Autogenerate ChangeLog from git changelog. 2015-01-24 17:29:50 +01:00
config-util.h.in Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
config.h.in Add configure option to reduce visual clutter at boot time 2017-06-23 10:07:57 +01:00
configure Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
configure.ac Add configure option to use vt.handoff=7 2017-06-23 10:07:57 +01:00
COPYING 2007-07-22 Yoshinori K. Okuji <okuji@enbug.org> 2007-07-21 23:32:33 +00:00
coreboot.cfg * coreboot.cfg: Add missing file. 2013-11-20 00:52:23 +01:00
geninit.sh automake commit without merge history 2010-05-06 11:34:04 +05:30
gentpl.py remove temporary .bin files (kernel and modules) 2015-12-31 23:00:25 +03:00
INSTALL INSTALL: Fix mention of thumb-clang. 2017-02-02 01:11:52 +01:00
linguas.sh linguas: Don't skip ko.po. 2017-02-04 00:06:57 +01:00
Makefile.am syslinux_test: Fix out-of-tree build handling 2017-06-23 11:35:06 +01:00
Makefile.in Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
Makefile.util.am Import grub2_2.02.orig.tar.xz 2017-06-23 10:07:51 +01:00
Makefile.util.def Output a menu entry for firmware setup on UEFI FastBoot systems 2017-06-23 10:07:56 +01:00
Makefile.utilgcry.def Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
NEWS NEWS updates 2016-11-22 20:51:54 +03:00
README README: Remove dead link to the wiki 2015-11-06 04:31:23 +01:00
stamp-h.in Import grub2_2.02~beta3.orig.tar.xz 2016-09-18 17:40:00 +01:00
THANKS 2009-12-11 Robert Millan <rmh.grub@aybabtu.com> 2009-12-11 22:44:47 +00:00
TODO TODO: Remove obsolete link 2016-02-12 17:51:52 +01:00

This is GRUB 2, the second version of the GRand Unified Bootloader.
GRUB 2 is rewritten from scratch to make GNU GRUB cleaner, safer, more
robust, more powerful, and more portable.

See the file NEWS for a description of recent changes to GRUB 2.

See the file INSTALL for instructions on how to build and install the
GRUB 2 data and program files.

Please visit the official web page of GRUB 2, for more information.
The URL is <http://www.gnu.org/software/grub/grub.html>.

More extensive documentation is available in the Info manual,
accessible using 'info grub' after building and installing GRUB 2.

There are a number of important user-visible differences from the
first version of GRUB, now known as GRUB Legacy. For a summary, please
see:

  info grub Introduction 'Changes from GRUB Legacy'