Message ID | 1428894996-7852-10-git-send-email-tytso@mit.edu |
---|---|
State | Accepted, archived |
Headers | show |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 2fb55fd..12d2592 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -1418,6 +1418,13 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, unsi return ERR_PTR(-EIO); } } + if (ext4_encrypted_inode(dir) && + !ext4_is_child_context_consistent_with_parent(dir, + dentry->d_inode)) { + printk(KERN_ERR "%s: Security warning: Inconsistent contexts\n", + __func__); + return ERR_PTR(-EINVAL); + } return d_splice_alias(inode, dentry); }