Skip to content

Commit

Permalink
integrity: ima iint radix_tree_lookup locking fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mimi Zohar authored and James Morris committed Feb 22, 2009
1 parent 1581e7d commit be38e0f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions security/integrity/ima/ima_iint.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ struct ima_iint_cache *ima_iint_insert(struct inode *inode)
if (rc < 0) {
kmem_cache_free(iint_cache, iint);
if (rc == -EEXIST) {
spin_lock(&ima_iint_lock);
iint = radix_tree_lookup(&ima_iint_store,
(unsigned long)inode);
spin_unlock(&ima_iint_lock);
} else
iint = NULL;
}
Expand Down

0 comments on commit be38e0f

Please sign in to comment.