mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH 0/1] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0
@ 2026-11-20 14:21 Rustam Mustafin
  2026-11-20 14:21 ` [RFC PATCH 1/1] " Rustam Mustafin
  0 siblings, 1 reply; 2+ messages in thread
From: Rustam Mustafin @ 2026-11-20 14:21 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen
  Cc: Jason Gunthorpe, Shuah Khan, Jaewon Yang, linux-integrity,
	linux-kselftest, linux-kernel, Rustam Mustafin

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-20 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-20 14:21 [RFC PATCH 0/1] tpm: Do not allow io_uring for /dev/tpm0 and /dev/tpmrm0 Rustam Mustafin
2026-11-20 14:21 ` [RFC PATCH 1/1] " Rustam Mustafin

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®