LSM: Infrastructure management of the file security
Move management of the file->f_security blob out of the
individual security modules and into the infrastructure.
The modules no longer allocate or free the data, instead
they tell the infrastructure how much space they require.
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
[kees: adjusted for ordered init series]
Signed-off-by: Kees Cook <keescook@chromium.org>
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h
index e0ac299..96374db 100644
--- a/security/selinux/include/objsec.h
+++ b/security/selinux/include/objsec.h
@@ -167,7 +167,7 @@
static inline struct file_security_struct *selinux_file(const struct file *file)
{
- return file->f_security;
+ return file->f_security + selinux_blob_sizes.lbs_file;
}
#endif /* _SELINUX_OBJSEC_H_ */