grub/grub-core/fs
Eric Biggers 734668238f 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>
2017-06-29 13:29:53 +00:00
..
zfs Fix warnings when compiling with -O3 2016-02-17 17:56:41 +01:00
affs.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
afs.c Leverage BFS implementation to read AFS. 2011-10-30 16:10:18 +01:00
archelp.c archelp: Never pass NULL as mtime. 2015-07-27 13:19:02 +02:00
bfs.c BFS: Convert to fshelp. 2015-07-27 12:48:38 +02:00
btrfs.c btrfs: avoid "used uninitialized" error with GCC7 2017-04-04 19:22:32 +03:00
cbfs.c cbfs: Fix corner case and compilation with recdent gcc 2015-11-09 03:24:04 +01:00
cpio.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
cpio_be.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
cpio_common.c fs/{cbfs,cpio}: Remove useless check if mode is NULL. 2015-01-27 16:32:21 +01:00
exfat.c exfat reader 2011-04-11 18:13:00 +02:00
ext2.c Allow GRUB to mount ext2/3/4 filesystems that have the encryption feature. 2017-06-29 13:29:53 +00:00
fat.c exfat: Support files over 4GiB 2017-01-27 22:10:21 +00:00
fshelp.c fshelp: Add handling of "." and ".." and grub_fshelp_find_file_lookup. 2015-07-27 12:45:35 +02:00
hfs.c hfs: fix memory leak 2016-01-09 11:36:42 +03:00
hfsplus.c Add missing initializers to silence suprious warnings. 2015-03-27 14:44:41 +01:00
hfspluscomp.c Make grub_zlib_decompress handle incomplete chunks. 2013-12-18 23:39:49 +01:00
iso9660.c Remove the variable oldname which is attempting to free stack space. 2016-03-15 22:04:38 +03:00
jfs.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
minix.c fs/minix: Fix sector promotion to 64-bit. 2015-01-25 20:32:31 +01:00
minix2.c Split minix.mod into minix.mod and minix2.mod. 2010-09-08 19:13:48 +02:00
minix2_be.c Handle big-endian minixfs (fixes minixfs tests on bigendian). 2012-04-01 21:35:18 +02:00
minix3.c minix3fs support 2011-04-11 08:16:13 +02:00
minix3_be.c Handle big-endian minixfs (fixes minixfs tests on bigendian). 2012-04-01 21:35:18 +02:00
minix_be.c Handle big-endian minixfs (fixes minixfs tests on bigendian). 2012-04-01 21:35:18 +02:00
newc.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
nilfs2.c Reject NILFS2 superblocks with over 1GiB blocks. 2015-01-21 17:42:10 +01:00
ntfs.c fs/ntfs: Add sizes sanity checks. 2015-01-25 20:32:31 +01:00
ntfscomp.c Fix warnings when compiling with -O3 2016-02-17 17:56:41 +01:00
odc.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
proc.c Switch procfs to use archelp. 2015-07-27 12:44:19 +02:00
reiserfs.c reiserfs: Fix handling of first entry in the directory. 2015-07-24 01:23:45 +02:00
romfs.c Remove nested functions from disk and file read hooks. 2013-02-27 17:19:15 +01:00
sfs.c fs/sfs: Fix error check and add sanity check. 2015-01-25 20:32:31 +01:00
squash4.c squash4: fix handling of fragments and sparse files 2017-02-24 19:10:43 +03:00
tar.c Add gcc_struct to all packed structures when compiling with mingw. 2013-12-15 14:14:30 +01:00
udf.c Document intentional fallthroughs. 2015-01-27 17:17:58 +01:00
ufs.c ufs: Fix parameters to grub_memset. 2015-10-09 13:35:40 +02:00
ufs2.c automake commit without merge history 2010-05-06 11:34:04 +05:30
ufs_be.c Support big-endian UFS1. 2012-12-08 20:56:58 +01:00
xfs.c xfs: accept filesystem with meta_uuid 2016-07-26 20:29:26 +03:00