From: Igor Opaniuk <igor.opaniuk@gmail.com>
To: u-boot@lists.u-boot-project.org
Cc: Tom Rini <trini@konsulko.com>,
Mattijs Korpershoek <mkorpershoek@kernel.org>,
Peter Robinson <pbrobinson@gmail.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Johan Jonker <jbx6244@gmail.com>,
Igor Opaniuk <igor.opaniuk@gmail.com>
Subject: [PATCH 3/4] avb: add board-specific root key provider
Date: Mon, 27 Jul 2026 19:14:15 +0200 [thread overview]
Message-ID: <20260727-avb-root-key-pluggable-v1-3-7e27b2b92cc0@gmail.com> (raw)
In-Reply-To: <20260727-avb-root-key-pluggable-v1-0-7e27b2b92cc0@gmail.com>
The strongest anchor for the root of trust is a key hash burned into
hardware (OTP/eFuse), which is inherently SoC-specific and cannot live in
common code. Give boards a hook to supply it from wherever their hardware
keeps it.
The default is deliberately fail-closed: a board that has not wired up a
provider refuses verification rather than silently trusting whatever key it
is handed. A misconfiguration should stop the boot, not quietly weaken it.
Signed-off-by: Igor Opaniuk <igor.opaniuk@gmail.com>
---
common/Kconfig | 9 +++++++++
common/avb_verify.c | 13 +++++++++++++
2 files changed, 22 insertions(+)
diff --git a/common/Kconfig b/common/Kconfig
index 094635bfe57..110eaa0d004 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -929,6 +929,15 @@ config AVB_ROOT_KEY_TEE
The digest must be provisioned into the TEE beforehand. Integrity is
provided by the TEE's (RPMB-backed) storage.
+config AVB_ROOT_KEY_BOARD
+ bool "SoC/board specific provider (weak function)"
+ help
+ Obtain the trusted root key digest from a board/SoC specific strong
+ definition of avb_read_root_key_digest() (for example reading a hash
+ fused into OTP/eFuse). The default weak implementation fails closed,
+ so a board that forgets to override it will refuse verification
+ rather than silently trust a wrong key.
+
endchoice
config AVB_ROOT_KEY_TEE_NAME
diff --git a/common/avb_verify.c b/common/avb_verify.c
index b8b99628180..b96cd1ebd7b 100644
--- a/common/avb_verify.c
+++ b/common/avb_verify.c
@@ -1091,6 +1091,19 @@ AvbIOResult avb_read_root_key_digest(AvbOps *ops, uint8_t *digest)
return AVB_IO_RESULT_OK;
}
+#else /* CONFIG_AVB_ROOT_KEY_BOARD */
+/*
+ * Weak, fail-closed default. A board/SoC selecting CONFIG_AVB_ROOT_KEY_BOARD
+ * must provide a strong avb_read_root_key_digest() (e.g. reading a hash fused
+ * into OTP/eFuse). If it does not, verification fails rather than silently
+ * trusting a wrong key.
+ */
+__weak AvbIOResult avb_read_root_key_digest(AvbOps *ops, uint8_t *digest)
+{
+ printf("%s: board root key provider not implemented\n", __func__);
+
+ return AVB_IO_RESULT_ERROR_NO_SUCH_VALUE;
+}
#endif
/**
--
2.53.0
next prev parent reply other threads:[~2026-07-27 17:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 17:14 [PATCH 0/4] avb: make the AVB root key source pluggable Igor Opaniuk
2026-07-27 17:14 ` [PATCH 1/4] " Igor Opaniuk
2026-08-10 9:41 ` Mattijs Korpershoek
2026-07-27 17:14 ` [PATCH 2/4] avb: add OP-TEE root key digest provider Igor Opaniuk
2026-08-10 9:43 ` Mattijs Korpershoek
2026-07-27 17:14 ` Igor Opaniuk [this message]
2026-08-10 9:44 ` [PATCH 3/4] avb: add board-specific root key provider Mattijs Korpershoek
2026-07-27 17:14 ` [PATCH 4/4] doc: android: document the AVB root key source Igor Opaniuk
2026-08-10 9:46 ` Mattijs Korpershoek
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=20260727-avb-root-key-pluggable-v1-3-7e27b2b92cc0@gmail.com \
--to=igor.opaniuk@gmail.com \
--cc=jbx6244@gmail.com \
--cc=mkorpershoek@kernel.org \
--cc=pbrobinson@gmail.com \
--cc=quentin.schulz@cherry.de \
--cc=trini@konsulko.com \
--cc=u-boot@lists.u-boot-project.org \
/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 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.