Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Rustam Mustafin <rmustafin@cloudlinux.com>
To: Peter Huewe <peterhuewe@gmx.de>, Jarkko Sakkinen <jarkko@kernel.org>
Cc: 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,
	Rustam Mustafin <rmustafin@cloudlinux.com>
Subject: [RFC PATCH 0/1] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
Date: Fri, 20 Nov 2026 21:21:15 +0700	[thread overview]
Message-ID: <20261120142116.1630010-1-rmustafin@cloudlinux.com> (raw)

Patch 1 blocks io_uring as suggested in the v1 review of the base
series. AIO is rejected the same way, and readv() and writev() keep
working.

The simpler alternative, read_iter/write_iter callbacks that just
return -EIO, would also break readv() and single-iovec writev(), which
work today as well, e.g. a readv() of the 10-byte response header and
the body into separate buffers.

This series requires "[PATCH v2 0/2] tpm: Track the response read
position internally":
https://lore.kernel.org/all/20261120121614.978396-1-rmustafin@cloudlinux.com/

On its own, patch 1 closes only the io_uring trace of the base series;
the read()/write() race trace stays. It also opens a new path: the new
->read_iter() lets vfs_iter_read() callers such as Coda reach
tpm_common_read() with their own offset. Today these calls fail,
because the TPM files have no ->read_iter(); without the base series
that offset would index data_buffer again.

Tested in a QEMU guest with swtpm and KASAN: the tpm2 selftests pass
with both series applied.
Claude Opus 5.5 was used in preparing this series.

Rustam Mustafin (1):
  tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0

 drivers/char/tpm/tpm-dev-common.c        | 72 ++++++++++++++++++++++++
 drivers/char/tpm/tpm-dev.c               |  4 ++
 drivers/char/tpm/tpm-dev.h               |  4 ++
 drivers/char/tpm/tpmrm-dev.c             |  4 ++
 tools/testing/selftests/tpm2/tpm_uring.c | 14 ++---
 5 files changed, 91 insertions(+), 7 deletions(-)


base-commit: 666539eecdf4db623f5e3c3e55cf9f2dfad24aa4
prerequisite-patch-id: 929c8a56f28a166a5961816bde23cb25204ac74a
prerequisite-patch-id: 624623d00390085ca69fae7309aee60aa27b163e
-- 
2.52.0


             reply	other threads:[~2026-11-20 14:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 14:21 Rustam Mustafin [this message]
2026-11-20 14:21 ` [RFC PATCH 1/1] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0 Rustam Mustafin
2026-11-20 14:55   ` 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=20261120142116.1630010-1-rmustafin@cloudlinux.com \
    --to=rmustafin@cloudlinux.com \
    --cc=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=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