IMA: update ima_counts_put
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Fri, 4 Sep 2009 17:08:46 +0000 (13:08 -0400)
committerJames Morris <jmorris@namei.org>
Mon, 7 Sep 2009 01:54:58 +0000 (11:54 +1000)
commitacd0c935178649f72c44ec49ca83bee35ce1f79e
treec0cb2f8fbbaa54567785b5430e5be8c8b51f5724
parente07cccf4046978df10f2e13fe2b99b2f9b3a65db
IMA: update ima_counts_put

- As ima_counts_put() may be called after the inode has been freed,
verify that the inode is not NULL, before dereferencing it.

- Maintain the IMA file counters in may_open() properly, decrementing
any counter increments on subsequent errors.

Reported-by: Ciprian Docan <docan@eden.rutgers.edu>
Reported-by: J.R. Okajima <hooanon05@yahoo.co.jp>
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Acked-by: Eric Paris <eparis@redhat.com
Signed-off-by: James Morris <jmorris@namei.org>
fs/namei.c
security/integrity/ima/ima_main.c