IMA: policy can be updated zero times
authorSasha Levin <sasha.levin@oracle.com>
Tue, 22 Dec 2015 13:51:23 +0000 (08:51 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 24 Dec 2015 23:56:45 +0000 (18:56 -0500)
commit0112721df4edbdd07b800813300d76811572f080
tree9ad07cfcfdd6aedb1c0764187b95646d05b83b1a
parent92cc916638a48f285736cd5541536e2e1b73ecf8
IMA: policy can be updated zero times

Commit "IMA: policy can now be updated multiple times" assumed that the
policy would be updated at least once.

If there are zero updates, the temporary list head object will get added
to the policy list, and later dereferenced as an IMA policy object, which
means that invalid memory will be accessed.

Changelog:
- Move list_empty() test to ima_release_policy(), before audit msg - Mimi

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima.h
security/integrity/ima/ima_fs.c
security/integrity/ima/ima_policy.c