SELinux: Abstract use of inode security blob

Don't use the inode->i_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:19:11 -07:00
committed by Kees Cook
parent 33bf60cabc
commit 80788c2291
3 changed files with 21 additions and 15 deletions

View File

@@ -170,4 +170,10 @@ static inline struct file_security_struct *selinux_file(const struct file *file)
return file->f_security + selinux_blob_sizes.lbs_file;
}
static inline struct inode_security_struct *selinux_inode(
const struct inode *inode)
{
return inode->i_security;
}
#endif /* _SELINUX_OBJSEC_H_ */