1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-11 17:10:13 +00:00

ecryptfs: Fix improper mknod pairing of start_creating()/end_removing()

The ecryptfs_start_creating_dentry() function must be paired with the
end_creating() function. Fix ecryptfs_mknod() so that end_creating() is
properly called in the return path, instead of end_removing().

Fixes: f046fbb4d81d ("ecryptfs: use new start_creating/start_removing APIs")
Signed-off-by: Tyler Hicks <code@tyhicks.com>
Link: https://patch.msgid.link/20251223194153.2818445-2-code@tyhicks.com
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
Tyler Hicks 2025-12-23 13:41:52 -06:00 committed by Christian Brauner
parent 3dd57ddec9
commit 5f9ad16bcc
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -584,7 +584,7 @@ ecryptfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
fsstack_copy_attr_times(dir, lower_dir);
fsstack_copy_inode_size(dir, lower_dir);
out:
end_removing(lower_dentry);
end_creating(lower_dentry);
if (d_really_is_negative(dentry))
d_drop(dentry);
return rc;