All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] cmd: optee_rpmb: make it usable by scripts
@ 2026-09-03 21:22 Rasmus Villemoes
  2026-09-03 21:22 ` [PATCH v2 1/4] cmd: optee_rpmb: sanitize TEE_ERROR -> E* translations Rasmus Villemoes
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Rasmus Villemoes @ 2026-09-03 21:22 UTC (permalink / raw)
  To: u-boot
  Cc: Igor Opaniuk, Mattijs Korpershoek, Ilias Apalodimas, Tom Rini,
	Rasmus Villemoes

This all started by wanting to be able to fetch a "persistent value"
from RPMB and use that in boot logic. I noticed that the "optee_rpmb
read_pvalue" subcommand had two flaws in that regard: No way to
actually store the result in e.g. an environment variable, and having
to know and provide a "large enough" size of the value.

For the former, it's just a matter of letting the caller provide the
name of an environment variable to store the result to in lieu of
printing it.

For the latter, the tee side should have provided a way to know if a
too small buffer was passed, but that was never actually implemented,
and instead a silently truncated value would be returned. That has
been fixed by adding a new variant of the
TA_AVB_CMD_READ_PERSIST_VALUE method which does yield an error along
with the proper size to allocate:
https://github.com/OP-TEE/optee_os/pull/7959 . That is not yet merged,
but I assume it will be soonish; these patches should not be applied
until it is.

v2:

- Drop the part touching common/avb_verify.c, now that the old
  TA_AVB_CMD_READ_PERSIST_VALUE method is not changed. That doesn't
  mean it shouldn't be updated at some point (the header file promises
  behaviour which is not actually implemented), but it is out of scope
  for what I intend to do currently.

- Do make use of the new method in optee_rpmb read_pvalue, and
  implement the "store result to env var".

v1: https://lore.kernel.org/u-boot/20260828105005.200338-1-ravi@prevas.dk/

Rasmus Villemoes (4):
  cmd: optee_rpmb: sanitize TEE_ERROR -> E* translations
  optee_ta_avb.h: add TA_AVB_CMD_READ_PERSIST_VALUE2 define
  cmd: optee_rpmb: allocate large enough buffer when reading persistent
    value
  cmd: optee_rpmb: make it usable by scripts

 cmd/optee_rpmb.c           | 70 ++++++++++++++++++++++++++------------
 include/tee/optee_ta_avb.h | 12 +++++++
 2 files changed, 61 insertions(+), 21 deletions(-)

-- 
2.55.0


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

end of thread, other threads:[~2026-09-07 16:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 21:22 [PATCH v2 0/4] cmd: optee_rpmb: make it usable by scripts Rasmus Villemoes
2026-09-03 21:22 ` [PATCH v2 1/4] cmd: optee_rpmb: sanitize TEE_ERROR -> E* translations Rasmus Villemoes
2026-09-07 12:05   ` Mattijs Korpershoek
2026-09-03 21:22 ` [PATCH v2 2/4] optee_ta_avb.h: add TA_AVB_CMD_READ_PERSIST_VALUE2 define Rasmus Villemoes
2026-09-07 12:07   ` Mattijs Korpershoek
2026-09-07 13:20     ` Rasmus Villemoes
2026-09-03 21:22 ` [PATCH v2 3/4] cmd: optee_rpmb: allocate large enough buffer when reading persistent value Rasmus Villemoes
2026-09-07 12:09   ` Mattijs Korpershoek
2026-09-03 21:22 ` [PATCH v2 4/4] cmd: optee_rpmb: make it usable by scripts Rasmus Villemoes

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.