diff options
author | Theodore Ts'o <tytso@mit.edu> | 2015-04-12 00:55:08 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-04-12 00:55:08 -0400 |
commit | d9cdc903318171571f1cd1e5737fd0cab94186be (patch) | |
tree | 5baa3a2fbd4a544fcf7ac7e5546b4b6a2ea25587 /fs/ext4/page-io.c | |
parent | 88bd6ccdcdd638faa11e9746affc21d5f2fe2acf (diff) | |
download | linux-d9cdc903318171571f1cd1e5737fd0cab94186be.tar.gz linux-d9cdc903318171571f1cd1e5737fd0cab94186be.tar.bz2 linux-d9cdc903318171571f1cd1e5737fd0cab94186be.zip |
ext4 crypto: enforce context consistency
Enforce the following inheritance policy:
1) An unencrypted directory may contain encrypted or unencrypted files
or directories.
2) All files or directories in a directory must be protected using the
same key as their containing directory.
As a result, assuming the following setup:
mke2fs -t ext4 -Fq -O encrypt /dev/vdc
mount -t ext4 /dev/vdc /vdc
mkdir /vdc/a /vdc/b /vdc/c
echo foo | e4crypt add_key /vdc/a
echo bar | e4crypt add_key /vdc/b
for i in a b c ; do cp /etc/motd /vdc/$i/motd-$i ; done
Then we will see the following results:
cd /vdc
mv a b # will fail; /vdc/a and /vdc/b have different keys
mv b/motd-b a # will fail, see above
ln a/motd-a b # will fail, see above
mv c a # will fail; all inodes in an encrypted directory
# must be encrypted
ln c/motd-c b # will fail, see above
mv a/motd-a c # will succeed
mv c/motd-a a # will succeed
Signed-off-by: Michael Halcrow <mhalcrow@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/page-io.c')
0 files changed, 0 insertions, 0 deletions