mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
ima: fix memory leak in ima_release_policy
When the "policy" securityfs file is opened for read, it is opened as a
sequential file. However, when it is eventually released, there is no
cleanup for the sequential file, therefore some memory is leaked.
This patch adds a call to seq_release() in ima_release_policy() to clean up
the memory when the file is opened for read.
Fixes: 80eae209d6 IMA: allow reading back the current policy
Reported-by: Colin Ian King <[email protected]>
Signed-off-by: Eric Richter <[email protected]>
Tested-by: Colin Ian King <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
This commit is contained in:
parent
185c0f26c0
commit
9a11a18902
1 changed files with 1 additions and 1 deletions
|
|
@ -401,7 +401,7 @@ static int ima_release_policy(struct inode *inode, struct file *file)
|
|||
const char *cause = valid_policy ? "completed" : "failed";
|
||||
|
||||
if ((file->f_flags & O_ACCMODE) == O_RDONLY)
|
||||
return 0;
|
||||
return seq_release(inode, file);
|
||||
|
||||
if (valid_policy && ima_check_policy() < 0) {
|
||||
cause = "failed";
|
||||
|
|
|
|||
Loading…
Reference in a new issue