• Eric Biggers's avatar
    Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature. · 2cbde6e5
    Eric Biggers authored
    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: default avatarEric 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
    2cbde6e5
ext234_test.in 659 Bytes