VFS: security/: d_backing_inode() annotations
most of the ->d_inode uses there refer to the same inode IO would go to, i.e. d_backing_inode() Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -72,7 +72,7 @@ static void __init evm_init_config(void)
|
||||
|
||||
static int evm_find_protected_xattrs(struct dentry *dentry)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
struct inode *inode = d_backing_inode(dentry);
|
||||
char **xattr;
|
||||
int error;
|
||||
int count = 0;
|
||||
@@ -165,8 +165,8 @@ static enum integrity_status evm_verify_hmac(struct dentry *dentry,
|
||||
/* Replace RSA with HMAC if not mounted readonly and
|
||||
* not immutable
|
||||
*/
|
||||
if (!IS_RDONLY(dentry->d_inode) &&
|
||||
!IS_IMMUTABLE(dentry->d_inode))
|
||||
if (!IS_RDONLY(d_backing_inode(dentry)) &&
|
||||
!IS_IMMUTABLE(d_backing_inode(dentry)))
|
||||
evm_update_evmxattr(dentry, xattr_name,
|
||||
xattr_value,
|
||||
xattr_value_len);
|
||||
@@ -235,7 +235,7 @@ enum integrity_status evm_verifyxattr(struct dentry *dentry,
|
||||
return INTEGRITY_UNKNOWN;
|
||||
|
||||
if (!iint) {
|
||||
iint = integrity_iint_find(dentry->d_inode);
|
||||
iint = integrity_iint_find(d_backing_inode(dentry));
|
||||
if (!iint)
|
||||
return INTEGRITY_UNKNOWN;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ EXPORT_SYMBOL_GPL(evm_verifyxattr);
|
||||
*/
|
||||
static enum integrity_status evm_verify_current_integrity(struct dentry *dentry)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
struct inode *inode = d_backing_inode(dentry);
|
||||
|
||||
if (!evm_initialized || !S_ISREG(inode->i_mode) || evm_fixmode)
|
||||
return 0;
|
||||
@@ -293,13 +293,13 @@ static int evm_protect_xattr(struct dentry *dentry, const char *xattr_name,
|
||||
if (evm_status == INTEGRITY_NOXATTRS) {
|
||||
struct integrity_iint_cache *iint;
|
||||
|
||||
iint = integrity_iint_find(dentry->d_inode);
|
||||
iint = integrity_iint_find(d_backing_inode(dentry));
|
||||
if (iint && (iint->flags & IMA_NEW_FILE))
|
||||
return 0;
|
||||
}
|
||||
out:
|
||||
if (evm_status != INTEGRITY_PASS)
|
||||
integrity_audit_msg(AUDIT_INTEGRITY_METADATA, dentry->d_inode,
|
||||
integrity_audit_msg(AUDIT_INTEGRITY_METADATA, d_backing_inode(dentry),
|
||||
dentry->d_name.name, "appraise_metadata",
|
||||
integrity_status_msg[evm_status],
|
||||
-EPERM, 0);
|
||||
@@ -379,7 +379,7 @@ void evm_inode_post_setxattr(struct dentry *dentry, const char *xattr_name,
|
||||
*/
|
||||
void evm_inode_post_removexattr(struct dentry *dentry, const char *xattr_name)
|
||||
{
|
||||
struct inode *inode = dentry->d_inode;
|
||||
struct inode *inode = d_backing_inode(dentry);
|
||||
|
||||
if (!evm_initialized || !evm_protected_xattr(xattr_name))
|
||||
return;
|
||||
@@ -404,7 +404,7 @@ int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
if ((evm_status == INTEGRITY_PASS) ||
|
||||
(evm_status == INTEGRITY_NOXATTRS))
|
||||
return 0;
|
||||
integrity_audit_msg(AUDIT_INTEGRITY_METADATA, dentry->d_inode,
|
||||
integrity_audit_msg(AUDIT_INTEGRITY_METADATA, d_backing_inode(dentry),
|
||||
dentry->d_name.name, "appraise_metadata",
|
||||
integrity_status_msg[evm_status], -EPERM, 0);
|
||||
return -EPERM;
|
||||
|
Reference in New Issue
Block a user