Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit fbf06cee authored by Enrico Bravi's avatar Enrico Bravi Committed by Mimi Zohar
Browse files

ima: fix wrong zero-assignment during securityfs dentry remove

In case of error during ima_fs_init() all the dentry already created
are removed. {ascii, binary}_securityfs_measurement_lists are freed
calling for each array the remove_securityfs_measurement_lists(). This
function, at the end, assigns to zero the securityfs_measurement_list_count.
This causes during the second call of remove_securityfs_measurement_lists()
to leave the dentry of the array pending, not removing them correctly,
because the securityfs_measurement_list_count is already zero.

Move the securityfs_measurement_list_count = 0 after the two
remove_securityfs_measurement_lists() calls to correctly remove all the
dentry already allocated.

Fixes: 9fa8e762

 ("ima: add crypto agility support for template-hash algorithm")
Signed-off-by: default avatarEnrico Bravi <enrico.bravi@polito.it>
Reviewed-by: default avatarRoberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
parent c3f38fa6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment