summaryrefslogtreecommitdiffstats
path: root/security/selinux/include
diff options
context:
space:
mode:
authorCasey Schaufler <casey@schaufler-ca.com>2021-04-22 17:41:15 +0200
committerJames Morris <jamorris@linux.microsoft.com>2021-04-22 12:22:10 -0700
commit1aea7808372eee4ad01f98e064c88c57f1e94855 (patch)
tree9af8673225655cc90571981691ddda9e3dcf3fcf /security/selinux/include
parentafe81f754117dd96853677c5cb815f49abef0ba0 (diff)
downloadlinux-1aea7808372eee4ad01f98e064c88c57f1e94855.tar.gz
linux-1aea7808372eee4ad01f98e064c88c57f1e94855.tar.bz2
linux-1aea7808372eee4ad01f98e064c88c57f1e94855.zip
LSM: Infrastructure management of the superblock
Move management of the superblock->sb_security blob out of the individual security modules and into the security infrastructure. Instead of allocating the blobs from within the modules, the modules tell the infrastructure how much space is required, and the space is allocated there. Cc: John Johansen <john.johansen@canonical.com> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com> Reviewed-by: Stephen Smalley <stephen.smalley.work@gmail.com> Acked-by: Serge Hallyn <serge@hallyn.com> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210422154123.13086-6-mic@digikod.net Signed-off-by: James Morris <jamorris@linux.microsoft.com>
Diffstat (limited to 'security/selinux/include')
-rw-r--r--security/selinux/include/objsec.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index ca4d7ab6a835..2953132408bf 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -188,4 +188,10 @@ static inline u32 current_sid(void)
return tsec->sid;
}
+static inline struct superblock_security_struct *selinux_superblock(
+ const struct super_block *superblock)
+{
+ return superblock->s_security + selinux_blob_sizes.lbs_superblock;
+}
+
#endif /* _SELINUX_OBJSEC_H_ */