/** * ima_iint_find - Return the iint associated with an inode * @inode: Pointer to the inode * * Return the IMA integrity information (iint) associated with an inode, if the * inode was processed by IMA. * * Return: Found iint or NULL.
*/ struct ima_iint_cache *ima_iint_find(struct inode *inode)
{ if (!IS_IMA(inode)) return NULL;
/* * It is not clear that IMA should be nested at all, but as long is it measures * files both on overlayfs and on underlying fs, we need to annotate the iint * mutex to avoid lockdep false positives related to IMA + overlayfs. * See ovl_lockdep_annotate_inode_mutex_key() for more details.
*/ staticinlinevoid ima_iint_lockdep_annotate(struct ima_iint_cache *iint, struct inode *inode)
{ #ifdef CONFIG_LOCKDEP staticstruct lock_class_key ima_iint_mutex_key[IMA_MAX_NESTING];
/** * ima_inode_get - Find or allocate an iint associated with an inode * @inode: Pointer to the inode * * Find an iint associated with an inode, and allocate a new one if not found. * Caller must lock i_mutex. * * Return: An iint on success, NULL on error.
*/ struct ima_iint_cache *ima_inode_get(struct inode *inode)
{ struct ima_iint_cache *iint;
iint = ima_iint_find(inode); if (iint) return iint;
iint = kmem_cache_alloc(ima_iint_cache, GFP_NOFS); if (!iint) return NULL;
/** * ima_inode_free_rcu - Called to free an inode via a RCU callback * @inode_security: The inode->i_security pointer * * Free the IMA data associated with an inode.
*/ void ima_inode_free_rcu(void *inode_security)
{ struct ima_iint_cache **iint_p = inode_security + ima_blob_sizes.lbs_inode;
/* *iint_p should be NULL if !IS_IMA(inode) */ if (*iint_p)
ima_iint_free(*iint_p);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.