All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] rpmb: add virtio RPMB driver
@ 2026-10-29  8:13 ` Haruka Kuze via OP-TEE
  0 siblings, 0 replies; 9+ messages in thread
From: Haruka Kuze @ 2026-10-29  8:13 UTC (permalink / raw)
  To: Jens Wiklander, Michael S . Tsirkin
  Cc: Arnd Bergmann, Greg Kroah-Hartman, Jason Wang, Eugenio Pérez,
	Xuan Zhuo, Sumit Garg, Alex Bennée, Tomas Winkler,
	Ulf Hansson, Harald Mommer, virtualization, op-tee, linux-kernel

This adds a driver on top of the rpmb subsystem for virtio-rpmb devices.

Alex Bennée had an earlier virtio-rpmb driver in his RPMB series [1]
but that stalled due to the user space API.

The one that merged later has no user space API and OP-TEE routes frames
through it so this driver only needs to implement route_frames().

I added patch 1 to fix a use-after-free that I hit while testing
removing the device (OP-TEE can still route frames after driver unregisters
the rpmb device).

I tested this with UML (virtio_uml) and a vhost-user backend I wrote
for this on top of rust-vmm's vhost-device with KASAN, lockdep:

 - key programming
 - write counter
 - single and multi block write and read
 - MAC and counter failures
 - max_wr_cnt
 - unbinding the driver when the rpmb device is held

With OP-TEE 4.11 on QEMU virt arm64 the secure_storage example TA keeps
its objects in RPMB through the driver and an object written to in one
boot is found in the one after.

I have added myself in MAINTAINERS. I would like to maintain the driver.

- haruka

[1] https://lore.kernel.org/all/20220405093759.1126835-1-alex.bennee@linaro.org/

Haruka Kuze (2):
  rpmb: stop the routing after unregister
  rpmb: add a virtio RPMB device driver

 MAINTAINERS                      |   7 +
 drivers/misc/Kconfig             |  10 ++
 drivers/misc/Makefile            |   1 +
 drivers/misc/rpmb-core.c         |  22 ++-
 drivers/misc/virtio_rpmb.c       | 294 +++++++++++++++++++++++++++++++
 include/linux/rpmb.h             |   4 +
 include/uapi/linux/virtio_rpmb.h |  56 ++++++
 7 files changed, 391 insertions(+), 3 deletions(-)
 create mode 100644 drivers/misc/virtio_rpmb.c
 create mode 100644 include/uapi/linux/virtio_rpmb.h


base-commit: c339f4010dea8b0d754f84ace70cd1b089878ef8
-- 
2.55.0


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

end of thread, other threads:[~2026-10-29  9:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-29  8:13 [PATCH 0/2] rpmb: add virtio RPMB driver Haruka Kuze
2026-10-29  8:13 ` Haruka Kuze via OP-TEE
2026-10-29  8:13 ` [PATCH 1/2] rpmb: stop the routing after unregister Haruka Kuze
2026-10-29  8:13   ` Haruka Kuze via OP-TEE
2026-10-29  8:20   ` sashiko-bot
2026-10-29  8:13 ` [PATCH 2/2] rpmb: add a virtio RPMB device driver Haruka Kuze
2026-10-29  8:13   ` Haruka Kuze via OP-TEE
2026-10-29  8:34   ` sashiko-bot
2026-10-29  9:01   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.