SELinux: Abstract use of file security blob

Don't use the file->f_security pointer directly.
Provide a helper function that provides the security blob pointer.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
Casey Schaufler
2018-09-21 17:22:32 -07:00
committed by Kees Cook
parent bbd3662a83
commit bb6c6b02cc
2 changed files with 14 additions and 9 deletions

View File

@@ -165,4 +165,9 @@ static inline struct task_security_struct *selinux_cred(const struct cred *cred)
return cred->security + selinux_blob_sizes.lbs_cred;
}
static inline struct file_security_struct *selinux_file(const struct file *file)
{
return file->f_security;
}
#endif /* _SELINUX_OBJSEC_H_ */