All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: "David Gstir" <david@sigma-star.at>,
	"Aymen Sghaier" <aymen.sghaier@nxp.com>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	"Jan Luebbe" <j.luebbe@pengutronix.de>,
	keyrings@vger.kernel.org,
	"Steffen Trumtrar" <s.trumtrar@pengutronix.de>,
	linux-security-module@vger.kernel.org,
	"Udit Agarwal" <udit.agarwal@nxp.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Horia Geantă" <horia.geanta@nxp.com>,
	"Richard Weinberger" <richard@nod.at>,
	"James Morris" <jmorris@namei.org>,
	"Eric Biggers" <ebiggers@kernel.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	"Sumit Garg" <sumit.garg@linaro.org>,
	"James Bottomley" <jejb@linux.ibm.com>,
	"Franck LENORMAND" <franck.lenormand@nxp.com>,
	"David Howells" <dhowells@redhat.com>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Jarkko Sakkinen" <jarkko@kernel.org>,
	linux-crypto@vger.kernel.org,
	"Sascha Hauer" <kernel@pengutronix.de>,
	linux-integrity@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 0/4] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys
Date: Tue, 24 Aug 2021 08:23:32 -0700	[thread overview]
Message-ID: <CAJ+vNU2q_KCi8nNv56s0ip7CZaAE=YgObwFUyzuGa_T1Ywp-wQ@mail.gmail.com> (raw)
In-Reply-To: <8b559c9c-a4c0-d335-5e54-40b9acc08707@pengutronix.de>

On Tue, Aug 24, 2021 at 12:33 AM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>
> On 23.08.21 19:50, Tim Harvey wrote:
> > On Mon, Aug 23, 2021 at 6:29 AM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >> On 20.08.21 23:19, Tim Harvey wrote:
> >>> On Fri, Aug 20, 2021 at 1:36 PM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
> >>>> On 20.08.21 22:20, Tim Harvey wrote:
> >>> It works for a user keyring but not a session keyring... does that
> >>> explain anything?
> >>> # keyctl add trusted mykey 'new 32' @u
> >>> 941210782
> >>> # keyctl print 941210782
> >>> 83b7845cb45216496aead9ee2c6a406f587d64aad47bddc539d8947a247e618798d9306b36398b5dc2722a4c3f220a3a763ee175f6bd64758fdd49ca4db597e8ce328121b60edbba9b8d8d55056be896
> >>> # keyctl add trusted mykey 'new 32' @s
> >>> 310571960
> >>> # keyctl print 310571960
> >>> keyctl_read_alloc: Unknown error 126
> >>
> >> Both sequences work for me.
> >>
> >> My getty is started by systemd. I think systemd allocates a new session
> >> keyring for the getty that's inherited by the shell and the commands I run
> >> it in. If you don't do that, each command will get its own session key.
> >>
> >>> Sorry, I'm still trying to wrap my head around the differences in
> >>> keyrings and trusted vs user keys.
> >>
> >> No problem. HTH.
> >
> > Ahmad,
> >
> > Ok that explains it - my testing is using a very basic buildroot
> > ramdisk rootfs. If I do a 'keyctl new_session' first I can use the
> > system keyring fine as well.
>
> Great. Does this mean I can get your Tested-by: ? :)
>

Absolutely,

For the series:

I tested this series on top of v5.14.rc-7 on a Gateworks
imx8mm-venice-gw73xx board with kernel param trusted.source=caam and
keyutils-1.6:
# keyctl new_session
22544757
# keyctl add trusted mykey 'new 32' @s
160701809
# keyctl print 160701809
990e03aa4515aee420eede17e26a58d0c5568c8bd2c9c2ee2f22a0583181d20d4f65cf9cb1f944a3cc92c0e3184a44a29a7e511f0a55a6af11a70ac2b2924514002475e73ae09820042896b9ee00a5ec

Tested-By: Tim Harvey <tharvey@gateworks.com>

One more question: I've got a user that wants to blob/deblob generic
data. They can use the caam_encap_blob/caam_decap_blob functions in
kernel code but could you give me a suggestion for how they could use
this in:
a) userspace code (using the keyctl syscall I assume)
b) userspace cmdline (via keyutils I assume)

Many thanks,

Tim

  reply	other threads:[~2021-08-24 15:23 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 16:48 [PATCH 0/4] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys Ahmad Fatoum
2021-07-21 16:48 ` [PATCH 1/4] KEYS: trusted: allow users to use kernel RNG for key material Ahmad Fatoum
2021-07-22  6:17   ` Sumit Garg
2021-07-21 16:48 ` [PATCH 2/4] KEYS: trusted: allow trust sources " Ahmad Fatoum
2021-07-22  6:31   ` Sumit Garg
2021-08-09  7:52     ` Ahmad Fatoum
2021-08-09  9:56       ` Jarkko Sakkinen
2021-08-10  5:24         ` Sumit Garg
2021-07-21 16:48 ` [PATCH 3/4] crypto: caam - add in-kernel interface for blob generator Ahmad Fatoum
2021-08-10 11:29   ` David Gstir
2021-08-11 10:22     ` Ahmad Fatoum
2021-08-11 10:43       ` David Gstir
2021-07-21 16:48 ` [PATCH 4/4] KEYS: trusted: Introduce support for NXP CAAM-based trusted keys Ahmad Fatoum
2021-08-06 15:12 ` [PATCH 0/4] " Ahmad Fatoum
2021-08-09  9:35   ` Jarkko Sakkinen
2021-08-09 10:16     ` Ahmad Fatoum
2021-08-10 11:28       ` David Gstir
2021-08-20 16:25         ` Ahmad Fatoum
2021-08-20 15:39 ` Tim Harvey
2021-08-20 16:19   ` Ahmad Fatoum
2021-08-20 20:20     ` Tim Harvey
2021-08-20 20:36       ` Ahmad Fatoum
2021-08-20 21:19         ` Tim Harvey
2021-08-23 13:29           ` Ahmad Fatoum
2021-08-23 17:50             ` Tim Harvey
2021-08-24  7:33               ` Ahmad Fatoum
2021-08-24 15:23                 ` Tim Harvey [this message]
2021-08-25  9:34                   ` Ahmad Fatoum

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='CAJ+vNU2q_KCi8nNv56s0ip7CZaAE=YgObwFUyzuGa_T1Ywp-wQ@mail.gmail.com' \
    --to=tharvey@gateworks.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=aymen.sghaier@nxp.com \
    --cc=davem@davemloft.net \
    --cc=david@sigma-star.at \
    --cc=dhowells@redhat.com \
    --cc=ebiggers@kernel.org \
    --cc=franck.lenormand@nxp.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=j.luebbe@pengutronix.de \
    --cc=jarkko@kernel.org \
    --cc=jejb@linux.ibm.com \
    --cc=jmorris@namei.org \
    --cc=kernel@pengutronix.de \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=s.trumtrar@pengutronix.de \
    --cc=serge@hallyn.com \
    --cc=sumit.garg@linaro.org \
    --cc=udit.agarwal@nxp.com \
    --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.