[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94f5f20b-f7c9-b9b5-1b49-3c4366b47370@pengutronix.de>
Date: Fri, 2 Dec 2022 13:05:31 +0100
From: Ahmad Fatoum <a.fatoum@...gutronix.de>
To: Nikolaus Voss <nikolaus.voss@...g-streit.com>,
Horia Geanta <horia.geanta@....com>,
Pankaj Gupta <pankaj.gupta@....com>,
Gaurav Jain <gaurav.jain@....com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
David Gstir <david@...ma-star.at>,
Steffen Trumtrar <s.trumtrar@...gutronix.de>,
Nikolaus Voss <nv@...n.de>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] crypto: caam: blob_gen.c: warn if key is insecure
Hi,
On 21.11.22 15:12, Nikolaus Voss wrote:
> + ctrlpriv = dev_get_drvdata(jrdev->parent);
> + moo = FIELD_GET(CSTA_MOO, ioread32(&ctrlpriv->ctrl->perfmon.status));
Sorry for not having spotted this the first time, but ioread32 is not
completely correct here as the CAAM may be big endian while the CPU is
little endian.
You should be using rd_reg32 here.
Cheers,
Ahmad
> + if (moo != CSTA_MOO_SECURE && moo != CSTA_MOO_TRUSTED)
> + dev_warn(jrdev,
> + "using insecure test key, enable HAB to use unique device key!\n");
> +
> /*
> * A data blob is encrypted using a blob key (BK); a random number.
> * The BK is used as an AES-CCM key. The initial block (B0) and the
> diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h
> index 66d6dad841bb2..66928f8a0c4b1 100644
> --- a/drivers/crypto/caam/regs.h
> +++ b/drivers/crypto/caam/regs.h
> @@ -426,6 +426,9 @@ struct caam_perfmon {
> u32 rsvd2;
> #define CSTA_PLEND BIT(10)
> #define CSTA_ALT_PLEND BIT(18)
> +#define CSTA_MOO GENMASK(9, 8)
> +#define CSTA_MOO_SECURE 1
> +#define CSTA_MOO_TRUSTED 2
> u32 status; /* CSTA - CAAM Status */
> u64 rsvd3;
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Powered by blists - more mailing lists