diff options
| -rw-r--r-- | fs/ext4/namei.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 8608118d2..f557def0e 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -3652,6 +3652,15 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, u8 new_file_type; int retval; + if ((ext4_encrypted_inode(old_dir) || + ext4_encrypted_inode(new_dir)) && + (old_dir != new_dir) && + (!ext4_is_child_context_consistent_with_parent(new_dir, + old.inode) || + !ext4_is_child_context_consistent_with_parent(old_dir, + new.inode))) + return -EPERM; + dquot_initialize(old.dir); dquot_initialize(new.dir); |
