Commit fbf06ce
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: 9fa8e76 ("ima: add crypto agility support for template-hash algorithm")
Signed-off-by: Enrico Bravi <[email protected]>
Reviewed-by: Roberto Sassu <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>1 parent c3f38fa commit fbf06ce
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
432 | 430 | | |
433 | 431 | | |
434 | 432 | | |
| |||
625 | 623 | | |
626 | 624 | | |
627 | 625 | | |
| 626 | + | |
628 | 627 | | |
629 | 628 | | |
630 | 629 | | |
| |||
0 commit comments