integrity: ima iint radix_tree_lookup locking fix
Based on Andrew Morton's comments: - add missing locks around radix_tree_lookup in ima_iint_insert() Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Cc: James Morris <jmorris@namei.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
@@ -73,8 +73,10 @@ out:
|
|||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
kmem_cache_free(iint_cache, iint);
|
kmem_cache_free(iint_cache, iint);
|
||||||
if (rc == -EEXIST) {
|
if (rc == -EEXIST) {
|
||||||
|
spin_lock(&ima_iint_lock);
|
||||||
iint = radix_tree_lookup(&ima_iint_store,
|
iint = radix_tree_lookup(&ima_iint_store,
|
||||||
(unsigned long)inode);
|
(unsigned long)inode);
|
||||||
|
spin_unlock(&ima_iint_lock);
|
||||||
} else
|
} else
|
||||||
iint = NULL;
|
iint = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user