path: root/security/security.c
diff options
authorMickaël Salaün <>2021-04-22 17:41:16 +0200
committerJames Morris <>2021-04-22 12:22:11 -0700
commit83e804f0bfee2247b1c0aa64845c81a38562da7a (patch)
tree18a47335116fa823fc6a29cb67c92e412064b583 /security/security.c
parentcb2c7d1a1776057c9a1f48ed1250d85e94d4850d (diff)
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 <> Cc: James Morris <> Signed-off-by: Mickaël Salaün <> Reviewed-by: Jann Horn <> Acked-by: Serge Hallyn <> Reviewed-by: Kees Cook <> Link: Signed-off-by: James Morris <>
Diffstat (limited to 'security/security.c')
1 files changed, 5 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c
index e9c29480eb18..bb666f992497 100644
--- a/security/security.c
+++ b/security/security.c
@@ -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);