All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roberto Sassu <roberto.sassu@huawei.com>
To: <zohar@linux.ibm.com>, <James.Bottomley@HansenPartnership.com>
Cc: <linux-integrity@vger.kernel.org>,
	<linux-security-module@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <silviu.vlasceanu@huawei.com>,
	Roberto Sassu <roberto.sassu@huawei.com>,
	<stable@vger.kernel.org>
Subject: [PATCH v4 2/7] ima: Evaluate error in init_ima()
Date: Wed, 25 Mar 2020 11:47:07 +0100	[thread overview]
Message-ID: <20200325104712.25694-3-roberto.sassu@huawei.com> (raw)
In-Reply-To: <20200325104712.25694-1-roberto.sassu@huawei.com>

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>
---
 security/integrity/ima/ima_main.c | 3 +++
 1 file changed, 3 insertions(+)

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);
-- 
2.17.1


  parent reply	other threads:[~2020-03-25 10:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 10:47 [PATCH v4 0/7] ima: support stronger algorithms for attestation Roberto Sassu
2020-03-25 10:47 ` [PATCH v4 1/7] ima: Switch to ima_hash_algo for boot aggregate Roberto Sassu
2020-04-02 23:53   ` Mimi Zohar
2020-05-08  4:54     ` Jerry Snitselaar
2020-05-08 17:29       ` Mimi Zohar
2020-03-25 10:47 ` Roberto Sassu [this message]
2020-03-27  0:07   ` [PATCH v4 2/7] ima: Evaluate error in init_ima() James Morris
2020-03-25 10:47 ` [PATCH v4 3/7] ima: Store template digest directly in ima_template_entry Roberto Sassu
2020-03-25 10:47 ` [PATCH v4 4/7] ima: Switch to dynamically allocated buffer for template digests Roberto Sassu
2020-03-25 10:52 ` [PATCH v4 5/7] ima: Allocate and initialize tfm for each PCR bank Roberto Sassu
2020-03-25 10:53 ` [PATCH v4 6/7] ima: Calculate and extend PCR with digests in ima_template_entry Roberto Sassu
2020-03-25 10:54 ` [PATCH v4 7/7] ima: Use ima_hash_algo for collision detection in the measurement list Roberto Sassu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200325104712.25694-3-roberto.sassu@huawei.com \
    --to=roberto.sassu@huawei.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=silviu.vlasceanu@huawei.com \
    --cc=stable@vger.kernel.org \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.