From: Jarkko Sakkinen <jarkko@kernel.org>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-kselftest@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
linux-integrity@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: kselftest and cargo
Date: Thu, 18 Sep 2025 18:15:03 +0300 [thread overview]
Message-ID: <aMwh95tMxB7sMEzy@kernel.org> (raw)
In-Reply-To: <aMwf89qekCuAdD1L@kernel.org>
On Thu, Sep 18, 2025 at 06:06:31PM +0300, Jarkko Sakkinen wrote:
> On Tue, Sep 16, 2025 at 04:39:37PM -0600, Shuah Khan wrote:
> > On 9/16/25 07:48, Jarkko Sakkinen wrote:
> > > Hi,
> > >
> > > The pre-existing kselftest for TPM2 is derived works of my earlier Python
> > > based rudimentary TPM2 stack called 'tpm2-scripts'.
> > >
> > > In order to get more coverage and more mainintainable and extensible test
> > > suite I'd like to eventually rewrite the tests with bash and tpm2sh, which
> > > is a TPM2 cli written with Rust and based on my new TPM2 stack [1] [2].
> > >
> > > Given linux-rust work, would it be acceptable to require cargo to install
> > > a runner for kselftest? I'm finishing off now 0.11 version of the tool,
> > > which will take some time (versions before that are honestly quite bad,
> > > don't try them) but after that this would be something I'd like to
> > > put together.
> >
> > Probably fine - how does this impact kselftest default run?
>
> OK so this was early query: I might introduce such test as part
> of series that hasa waited for long time for an update [1]. I can
> use tpm2sh more easily to reproduce equivalent crypto as kernel
> does and make a test that can compare the results in a meaningful
> manner. I also plan to relocate tpm2sh as part of git.kernel.org
> custody from Github, as its main dependency tpm2-protocol crate
> already is [2].
Some motivation context, I left out on doing the aforementioned
patch set because I did not see importing TPM2 keys useful enough
application but recently I've been dealing with remote attestation
and that levels up the feature something quite useful.
I.e. so called attestation identity keys are persisted to the NVRAM of a
TPM chip and it would great if kernel could at boot time reserve
selected (in the command-line) NV indexes and wrap them up into keyring
keys. Since in UKI model command-line is signed that effectively locks
them in into controlled use only through keyring as kernel can
guard that via the device.
I could put tons more detail into this but point to open up this
complexity is that getting all cryptography right is easiest done
by reproducing it in a test in user space and comparing the
results, and Rust and the crate I did give sort of powerful
way to describe all this. And also because of the complexity
it needs to be anchroed with some kind of sufficient test.
BR, Jarkko
next prev parent reply other threads:[~2025-09-18 15:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-16 13:48 kselftest and cargo Jarkko Sakkinen
2025-09-16 13:52 ` Jarkko Sakkinen
2025-09-16 22:39 ` Shuah Khan
2025-09-18 15:06 ` Jarkko Sakkinen
2025-09-18 15:15 ` Jarkko Sakkinen [this message]
2025-09-18 16:04 ` Shuah Khan
2025-09-18 16:35 ` Jarkko Sakkinen
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=aMwh95tMxB7sMEzy@kernel.org \
--to=jarkko@kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/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 NNTP newsgroup(s).