fs,security: Add sb_delete hook
The sb_delete security hook is called when shutting down a superblock, which may be useful to release kernel objects tied to the superblock's lifetime (e.g. inodes). This new hook is needed by Landlock to release (ephemerally) tagged struct inodes. This comes from the unprivileged nature of Landlock described in the next commit. Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: James Morris <jmorris@namei.org> Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com> Reviewed-by: Jann Horn <jannh@google.com> Acked-by: Serge Hallyn <serge@hallyn.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210422154123.13086-7-mic@digikod.net Signed-off-by: James Morris <jamorris@linux.microsoft.com>
This commit is contained in:
committed by
James Morris
parent
cb2c7d1a17
commit
83e804f0bf
@@ -900,6 +900,11 @@ int security_sb_alloc(struct super_block *sb)
|
||||
return rc;
|
||||
}
|
||||
|
||||
void security_sb_delete(struct super_block *sb)
|
||||
{
|
||||
call_void_hook(sb_delete, sb);
|
||||
}
|
||||
|
||||
void security_sb_free(struct super_block *sb)
|
||||
{
|
||||
call_void_hook(sb_free_security, sb);
|
||||
|
||||
Reference in New Issue
Block a user