mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Rustam Mustafin <rmustafin@cloudlinux.com>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	Shuah Khan <shuah@kernel.org>, Jaewon Yang <yong010301@gmail.com>,
	linux-integrity@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
Date: Wed, 25 Nov 2026 19:18:28 +0200	[thread overview]
Message-ID: <awcYZNG9f2YSIz49@kernel.org> (raw)
In-Reply-To: <awcW90qZvOim7dbh@kernel.org>

On Wed, Nov 25, 2026 at 07:12:28PM +0200, Jarkko Sakkinen wrote:
> On Wed, Nov 25, 2026 at 06:59:02PM +0200, Jarkko Sakkinen wrote:
> > On Wed, Nov 25, 2026 at 01:54:28PM +0700, Rustam Mustafin wrote:
> > > io_uring passes its own file offset to the TPM character devices, although
> > > they are opened with nonseekable_open(): IORING_OP_READ copies sqe->off
> > > into ki_pos without checking FMODE_PREAD. The devices also keep a single
> > > command and response per open file, which does not fit asynchronous
> > > requests.
> > > 
> > > Add tpm_common_read_iter() and tpm_common_write_iter(), which fail io_uring
> > > and AIO requests with -EIO. A multishot read uses a synchronous kiocb, so
> > > also reject IOCB_NOWAIT and io-wq workers. The callbacks call
> > > tpm_common_read() and tpm_common_write() once per iovec, so readv() can
> > > still split a response into the header and the body.
> > > 
> > > Signed-off-by: Rustam Mustafin <rmustafin@cloudlinux.com>
> > 
> > Checkpatch with strict afaik already complains about assisted-by and
> > it is not a discussion topic for me. I make people do enough effort
> > to the patches so that they can call them of their own :-)
> > 
> > Br, Jarkko
> 
> b4 shazam for the message-id:
> 
>  mutt -e "source ~/.mutt/muttrc.kernel"
> Grabbing thread from lore.kernel.org/all/20261125065429.1483868-1-rmustafin@cloudlinux.com/t.mbox.gz
> Checking for newer revisions
> Grabbing search results from lore.kernel.org
> Analyzing 8 messages in the thread
> WARNING: duplicate messages found at index 1
>    Subject 1: tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
>    Subject 2: tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
>   2 is not a reply... assume additional patch
> WARNING: duplicate messages found at index 2
>    Subject 1: selftests: tpm2: test that io_uring reads are rejected
>    Subject 2: tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
>   2 is not a reply... assume additional patch
> Analyzing 0 code-review messages
> Checking attestation on all messages, may take a moment...
> ---
>   ✓ [PATCH v3 1/2] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
>     ✓ Signed: DKIM/cloudlinux.com
>     + Link: https://lore.kernel.org/r/20261124142432.368943-2-rmustafin@cloudlinux.com
>     + Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
>   ✓ [PATCH v3 2/2] selftests: tpm2: test that io_uring reads are rejected
>     ✓ Signed: DKIM/cloudlinux.com
>     + Link: https://lore.kernel.org/r/20261124142432.368943-3-rmustafin@cloudlinux.com
>     + Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
>   ✓ [PATCH v3 1/2] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
>     ✓ Signed: DKIM/cloudlinux.com
>     + Link: https://lore.kernel.org/r/20261125065429.1483868-1-rmustafin@cloudlinux.com
>     + Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
>   ERROR: missing [4/2]!
> ---
> Total patches: 3
> ---
> WARNING: Thread incomplete!
> Applying: tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
> Applying: selftests: tpm2: test that io_uring reads are rejected
> Applying: tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
> Patch failed at 0003 tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
> error: patch failed: drivers/char/tpm/tpm-dev-common.c:13
> error: drivers/char/tpm/tpm-dev-common.c: patch does not apply
> error: patch failed: drivers/char/tpm/tpm-dev.c:62
> error: drivers/char/tpm/tpm-dev.c: patch does not apply
> error: patch failed: drivers/char/tpm/tpm-dev.h:28
> error: drivers/char/tpm/tpm-dev.h: patch does not apply
> error: patch failed: drivers/char/tpm/tpmrm-dev.c:49
> error: drivers/char/tpm/tpmrm-dev.c: patch does not apply
> hint: Use 'git am --show-current-patch=diff' to see the failed patch
> hint: When you have resolved this problem, run "git am --continue".
> hint: If you prefer to skip this patch, run "git am --skip" instead.
> hint: To restore the original branch and stop patching, run "git am --abort".
> hint: Disable this message with "git config advice.mergeConflict false"
> Press any key to continue...

I got them applied with git am. It's better to use separate threads per
patch set version.

They are in  my master branch now.

Br, Jarkko

  reply	other threads:[~2026-11-25 17:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 14:24 [PATCH v3 0/2] " Rustam Mustafin
2026-11-24 14:24 ` [PATCH v3 1/2] " Rustam Mustafin
2026-11-24 17:22   ` Jarkko Sakkinen
2026-11-25  6:54     ` Rustam Mustafin
2026-11-25  6:54       ` [PATCH v3 2/2] selftests: tpm2: test that io_uring reads are rejected Rustam Mustafin
2026-11-25 16:57         ` Jarkko Sakkinen
2026-11-25 16:58       ` [PATCH v3 1/2] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0 Jarkko Sakkinen
2026-11-25 17:12         ` Jarkko Sakkinen
2026-11-25 17:18           ` Jarkko Sakkinen [this message]
2026-11-24 14:24 ` [PATCH v3 2/2] selftests: tpm2: test that io_uring reads are rejected Rustam Mustafin

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=awcYZNG9f2YSIz49@kernel.org \
    --to=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    --cc=rmustafin@cloudlinux.com \
    --cc=shuah@kernel.org \
    --cc=yong010301@gmail.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

all inboxes | Powered by JetHome®