Keyrings Archive mirror
 help / color / mirror / Atom feed
From: Kshitiz Varshney <kshitiz.varshney@nxp.com>
To: David Gstir <david@sigma-star.at>,
	sigma star Kernel Team <upstream+dcp@sigma-star.at>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	Jarkko Sakkinen <jarkko@kernel.org>,
	Mimi Zohar <zohar@linux.ibm.com>,
	David Howells <dhowells@redhat.com>,
	Paul Moore <paul@paul-moore.com>,
	James Morris <jmorris@namei.org>,
	"Serge E . Hallyn" <serge@hallyn.com>,
	SCE_Linux_Security_team@msteams.nxp.com
Cc: linux-integrity@vger.kernel.org, keyrings@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Kshitiz Varshney <kshitiz.varshney@nxp.com>
Subject: [PATCH v1] trusted_dcp.c: Do not return in case of non-secure mode
Date: Mon, 10 Feb 2025 12:46:06 +0100	[thread overview]
Message-ID: <20250210114606.1593650-1-kshitiz.varshney@nxp.com> (raw)

There are multiple type of keys in different worlds, like
test key in case of non-secure world and OTP, unique key
in case of secure world.
So, instead of returning with an error, in case of test key, we
should display warning to the user and allow the user to run the
trusted key functionality with test key.

Signed-off-by: Kshitiz Varshney <kshitiz.varshney@nxp.com>
---
 security/keys/trusted-keys/trusted_dcp.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/security/keys/trusted-keys/trusted_dcp.c b/security/keys/trusted-keys/trusted_dcp.c
index e908c53a803c..99c9f9619f4f 100644
--- a/security/keys/trusted-keys/trusted_dcp.c
+++ b/security/keys/trusted-keys/trusted_dcp.c
@@ -319,11 +319,8 @@ static int trusted_dcp_init(void)
 		pr_info("Using DCP OTP key\n");
 
 	ret = test_for_zero_key();
-	if (ret) {
-		pr_warn("Test for zero'ed keys failed: %i\n", ret);
-
-		return -EINVAL;
-	}
+	if (ret)
+		pr_warn("Using insecure test key, enable HAB to use unique device key!\n");
 
 	return register_key_type(&key_type_trusted);
 }
-- 
2.25.1


             reply	other threads:[~2025-02-10 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-10 11:46 Kshitiz Varshney [this message]
2025-02-10 11:58 ` [PATCH v1] trusted_dcp.c: Do not return in case of non-secure mode Richard Weinberger

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=20250210114606.1593650-1-kshitiz.varshney@nxp.com \
    --to=kshitiz.varshney@nxp.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=SCE_Linux_Security_team@msteams.nxp.com \
    --cc=david@sigma-star.at \
    --cc=dhowells@redhat.com \
    --cc=jarkko@kernel.org \
    --cc=jmorris@namei.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=serge@hallyn.com \
    --cc=upstream+dcp@sigma-star.at \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).