summaryrefslogtreecommitdiff
path: root/drivers/virt
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-05-14 17:48:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-28 17:28:15 +0300
commit270ea0b617251d89b79ef36b8ef3b02fb1e6a04d (patch)
tree7facf0fd9203808f567fb644eb52d8d53fabd5bf /drivers/virt
parent327276cb8a7eb15a85e3f2fac7cd953c42afadd2 (diff)
downloadlinux-270ea0b617251d89b79ef36b8ef3b02fb1e6a04d.tar.xz
fix locking in efi_secret_unlink()
[ Upstream commit 2c58d42de71f9c73e40afacc9d062892d2cc8862 ] We used to need securityfs_remove() to undo simple_pin_fs() done when the file had been created and to drop the second extra reference taken at the same time. Now that neither is needed (or done by securityfs_remove()), we can simply call simple_unlink() and be done with that - the broken games with locking had been there only for the sake of securityfs_remove(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/virt')
-rw-r--r--drivers/virt/coco/efi_secret/efi_secret.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/virt/coco/efi_secret/efi_secret.c b/drivers/virt/coco/efi_secret/efi_secret.c
index e700a5ef7043..d996feb0509a 100644
--- a/drivers/virt/coco/efi_secret/efi_secret.c
+++ b/drivers/virt/coco/efi_secret/efi_secret.c
@@ -136,15 +136,7 @@ static int efi_secret_unlink(struct inode *dir, struct dentry *dentry)
if (s->fs_files[i] == dentry)
s->fs_files[i] = NULL;
- /*
- * securityfs_remove tries to lock the directory's inode, but we reach
- * the unlink callback when it's already locked
- */
- inode_unlock(dir);
- securityfs_remove(dentry);
- inode_lock(dir);
-
- return 0;
+ return simple_unlink(inode, dentry);
}
static const struct inode_operations efi_secret_dir_inode_operations = {