]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lsm: add new securityfs delete function
authorFan Wu <wufan@linux.microsoft.com>
Sat, 3 Aug 2024 06:08:21 +0000 (23:08 -0700)
committerPaul Moore <paul@paul-moore.com>
Tue, 20 Aug 2024 18:02:06 +0000 (14:02 -0400)
commit7138679ff2a2b1674f16618558d6cabea6ab2c53
tree9b49f02fc98fdce0d5c87464f83a08fae269aed8
parenta8a74df150835f5ceff89d40fadda1cf3961fdae
lsm: add new securityfs delete function

When deleting a directory in the security file system, the existing
securityfs_remove requires the directory to be empty, otherwise
it will do nothing. This leads to a potential risk that the security
file system might be in an unclean state when the intended deletion
did not happen.

This commit introduces a new function securityfs_recursive_remove
to recursively delete a directory without leaving an unclean state.

Co-developed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Fan Wu <wufan@linux.microsoft.com>
[PM: subject line tweak]
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/security.h
security/inode.c