From: Jarkko Sakkinen <jarkko@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
David Howells <dhowells@redhat.com>,
keyrings@vger.kernel.org, linux-integrity@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jonathan McDowell <noodles@meta.com>
Subject: Re: [GIT PULL] TPM DEVICE DRIVER: tpmdd-next-v6.18
Date: Mon, 6 Oct 2025 15:33:56 +0300 [thread overview]
Message-ID: <aOO3NKegSrUQ4ewg@kernel.org> (raw)
In-Reply-To: <CAHk-=whSe9AGigVydkwo=ewE6_GFTJ_rU=XzO=v1N1sWyfVmAw@mail.gmail.com>
On Sun, Oct 05, 2025 at 11:24:09AM -0700, Linus Torvalds wrote:
> On Sun, 5 Oct 2025 at 08:47, Jarkko Sakkinen <jarkko@kernel.org> wrote:
> >
> > and apologies for this late pull request. This pull request disables
> > TCG_TPM2_HMAC from the default configuration as it does not perform well
> > enough
>
> So having looked more at this, not only does it disable that
> TCG_TPM2_HMAC, it does a lot of other things too.
>
> I really am going to require a better pull request, and I have thrown
> this one away.
What I think I think it is good call.
>
> The exclusive access looks debatable to me too. I think you should
> also require that the open was done not only with O_EXCL, but as a
> write too.
>
> Exclusive reads do not make sense.
True, I agree with this.
After reading this email I realized also another issue with these patch
when I tested them sequentially building a VM for each commit ID.
Without "tpm: Require O_EXCL for exclusive /dev/tpm access" applied,
there's a regression: usually a daemon of some sort opens /dev/tpm0:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tpm2-abrm 771444 tss 5u CHR 10,224 0t0 94 /dev/tpm0
Without top patch this leaves /dev/tpmrm0 unusuable, which is a huge
developer experience downgrade as it is nice and covenient device
to try and do things. I.e. tail patch needs to be squashed and
the whole patch set needs to be re-reviewed.
I don't know systemd source code too well, but after eading
documentation of systemd-cryptenroll, it can also use /dev/tpmrm0:
https://www.freedesktop.org/software/systemd/man/latest/systemd-cryptenroll.html
Based on this it's now like there's a breaking patch and the top
most patch fixes the bug.
And based on this I'm happy to postpone O_EXCL changes to 6.19.
Patch set just needs to be restructured better so that in-the
middle of the series patches don't break things. And also it'd
be better if this patch would be relocated as the first in the
series: "tpm: Remove tpm_find_get_ops".
>
> Now, I certainly *hope* that nobody has /dev/tmp being world-readable,
> so it probably doesn't matter, but that new exclusive access thing is
> very different than what the code used to do, and if I read it
> correctly it will also disable the kernel doing certain operations. So
> it needs to be as limited as possible.
Not disagreeing with this.
>
> And damn it, it needs to be *explained*. Not have a pull request where
> one single line is explained badly.
'll send tomorrow a new PR without O_EXCL patches.
As per hmac encryption, I think my decision was the right call
but cover letter did suck agreed (sorry about that).
>
> Linus
BR, Jarkko
next prev parent reply other threads:[~2025-10-06 12:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-05 15:47 [GIT PULL] TPM DEVICE DRIVER: tpmdd-next-v6.18 Jarkko Sakkinen
2025-10-05 18:09 ` Linus Torvalds
2025-10-06 11:58 ` Jarkko Sakkinen
2025-10-06 14:12 ` Jarkko Sakkinen
2025-10-06 14:18 ` Jarkko Sakkinen
2025-10-06 14:30 ` Jarkko Sakkinen
2025-10-06 14:33 ` James Bottomley
2025-10-06 16:51 ` Jarkko Sakkinen
2025-10-06 16:57 ` Jarkko Sakkinen
2025-10-07 14:32 ` Jarkko Sakkinen
2025-10-07 14:38 ` Jarkko Sakkinen
2025-10-06 17:02 ` Jonathan McDowell
2025-10-06 18:50 ` Jarkko Sakkinen
2025-10-05 18:24 ` Linus Torvalds
2025-10-06 12:33 ` Jarkko Sakkinen [this message]
2025-10-06 21:40 ` Jonathan McDowell
2025-10-06 22:09 ` Linus Torvalds
2025-10-06 23:11 ` James Bottomley
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=aOO3NKegSrUQ4ewg@kernel.org \
--to=jarkko@kernel.org \
--cc=dhowells@redhat.com \
--cc=jgg@ziepe.ca \
--cc=keyrings@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=noodles@meta.com \
--cc=peterhuewe@gmx.de \
--cc=torvalds@linux-foundation.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