summaryrefslogtreecommitdiff
path: root/security/integrity/ima/ima_main.c
diff options
context:
space:
mode:
authorRoberto Sassu <roberto.sassu@huawei.com>2020-03-25 11:47:07 +0100
committerMimi Zohar <zohar@linux.ibm.com>2020-04-19 22:03:39 -0400
commite144d6b265415ddbdc54b3f17f4f95133effa5a8 (patch)
tree734e98b8c25dd1ab0e55b9393cd83dfe9beab1b7 /security/integrity/ima/ima_main.c
parent6f1a1d103b48b1533a9c804e7a069e2c8e937ce7 (diff)
downloadlwn-e144d6b265415ddbdc54b3f17f4f95133effa5a8.tar.gz
lwn-e144d6b265415ddbdc54b3f17f4f95133effa5a8.zip
ima: Evaluate error in init_ima()
Evaluate error in init_ima() before register_blocking_lsm_notifier() and return if not zero. Cc: stable@vger.kernel.org # 5.3.x Fixes: b16942455193 ("ima: use the lsm policy update notifier") Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com> Reviewed-by: James Morris <jamorris@linux.microsoft.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'security/integrity/ima/ima_main.c')
-rw-r--r--security/integrity/ima/ima_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
index 9d0abedeae77..f96f151294e6 100644
--- a/security/integrity/ima/ima_main.c
+++ b/security/integrity/ima/ima_main.c
@@ -792,6 +792,9 @@ static int __init init_ima(void)
error = ima_init();
}
+ if (error)
+ return error;
+
error = register_blocking_lsm_notifier(&ima_lsm_policy_notifier);
if (error)
pr_warn("Couldn't register LSM notifier, error %d\n", error);