diff options
| author | Ingo Molnar <mingo@kernel.org> | 2016-02-22 10:26:05 +0300 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2016-02-22 10:26:05 +0300 |
| commit | ab876728a91d89e93e4928895529cd5bb4dff6e4 (patch) | |
| tree | 3aa7603c289f79a570cf15e4019b1acb9459e608 /fs/ext4/file.c | |
| parent | 35575e0e8ba633fc8276509a21f89b599b4f9006 (diff) | |
| parent | 81f70ba233d5f660e1ea5fe23260ee323af5d53a (diff) | |
| download | linux-ab876728a91d89e93e4928895529cd5bb4dff6e4.tar.xz | |
Merge tag 'v4.5-rc5' into efi/core, before queueing up new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/ext4/file.c')
| -rw-r--r-- | fs/ext4/file.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 1126436dada1..474f1a4d2ca8 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c @@ -350,6 +350,7 @@ static int ext4_file_open(struct inode * inode, struct file * filp) struct super_block *sb = inode->i_sb; struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct vfsmount *mnt = filp->f_path.mnt; + struct inode *dir = filp->f_path.dentry->d_parent->d_inode; struct path path; char buf[64], *cp; int ret; @@ -393,6 +394,14 @@ static int ext4_file_open(struct inode * inode, struct file * filp) if (ext4_encryption_info(inode) == NULL) return -ENOKEY; } + if (ext4_encrypted_inode(dir) && + !ext4_is_child_context_consistent_with_parent(dir, inode)) { + ext4_warning(inode->i_sb, + "Inconsistent encryption contexts: %lu/%lu\n", + (unsigned long) dir->i_ino, + (unsigned long) inode->i_ino); + return -EPERM; + } /* * Set up the jbd2_inode if we are opening the inode for * writing and the journal is present |
