diff options
| author | Theodore Ts'o <tytso@google.com> | 2015-05-28 21:39:33 -0400 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-05-27 19:40:04 +0200 |
| commit | b501a49487dbddaade3e0b5b777984bda4052929 (patch) | |
| tree | c7b33fe4bf87fbde2937c2e428312806b3a7183f | |
| parent | 43d72c397633a45736b4eb14e11494dd52081f27 (diff) | |
ext4 crypto: make sure the encryption info is initialized on opendir(2)
Change-Id: Ie78f2f807c0b3bc5959d2b601f18826f2658984d
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Theodore Ts'o <tytso@google.com>
| -rw-r--r-- | fs/ext4/dir.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index f64d898dd..f5a0f088c 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c @@ -608,6 +608,13 @@ finished: return 0; } +static int ext4_dir_open(struct inode * inode, struct file * filp) +{ + if (ext4_encrypted_inode(inode)) + return ext4_get_encryption_info(inode) ? -EACCES : 0; + return 0; +} + static int ext4_release_dir(struct inode *inode, struct file *filp) { if (filp->private_data) @@ -650,5 +657,6 @@ const struct file_operations ext4_dir_operations = { .compat_ioctl = ext4_compat_ioctl, #endif .fsync = ext4_sync_file, + .open = ext4_dir_open, .release = ext4_release_dir, }; |
