1 ext4 crypto: enforce crypto policy restrictions on cross-renames
3 Thanks to Chao Yu <chao2.yu@samsung.com> for pointing out the need for
6 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
8 fs/ext4/namei.c | 9 +++++++++
9 1 file changed, 9 insertions(+)
11 diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
12 index 8888977..24fc7a5 100644
15 @@ -3653,6 +3653,15 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry,
19 + if ((ext4_encrypted_inode(old_dir) ||
20 + ext4_encrypted_inode(new_dir)) &&
21 + (old_dir != new_dir) &&
22 + (!ext4_is_child_context_consistent_with_parent(new_dir,
24 + !ext4_is_child_context_consistent_with_parent(old_dir,
28 dquot_initialize(old.dir);
29 dquot_initialize(new.dir);