Smack: 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:

committed by
Kees Cook

parent
80788c2291
commit
fb4021b6fb
@@ -368,12 +368,17 @@ static inline struct smack_known **smack_file(const struct file *file)
|
||||
smack_blob_sizes.lbs_file);
|
||||
}
|
||||
|
||||
static inline struct inode_smack *smack_inode(const struct inode *inode)
|
||||
{
|
||||
return inode->i_security;
|
||||
}
|
||||
|
||||
/*
|
||||
* Is the directory transmuting?
|
||||
*/
|
||||
static inline int smk_inode_transmutable(const struct inode *isp)
|
||||
{
|
||||
struct inode_smack *sip = isp->i_security;
|
||||
struct inode_smack *sip = smack_inode(isp);
|
||||
return (sip->smk_flags & SMK_INODE_TRANSMUTE) != 0;
|
||||
}
|
||||
|
||||
@@ -382,7 +387,7 @@ static inline int smk_inode_transmutable(const struct inode *isp)
|
||||
*/
|
||||
static inline struct smack_known *smk_of_inode(const struct inode *isp)
|
||||
{
|
||||
struct inode_smack *sip = isp->i_security;
|
||||
struct inode_smack *sip = smack_inode(isp);
|
||||
return sip->smk_inode;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user