On 2026-07-21T02:34:47, Daniel Golle <[email protected]> wrote:
> boot: fit: cover the dm-verity roothash with the config signature
>
> A dm-verity protected filesystem image is not hashed by U-Boot when it
> is loaded; its integrity is delegated to the kernel, which validates the
> filesystem on the fly against the roothash taken from the FIT dm-verity
> subnode. The roothash is therefore the sole integrity anchor for the
> filesystem, yet fit_config_add_hash() only adds the image node, its
> hash subnodes and its cipher subnode to the signed region, leaving the
> dm-verity subnode (roothash, salt and block parameters) unsigned.
>
> An attacker able to rewrite the boot medium could then replace both the
> filesystem and the roothash, recompute a matching dm-verity tree and
> keep the configuration signature valid, defeating verified boot for the
> root filesystem.
>
> Add the dm-verity subnode to the list of nodes covered by the
> configuration signature, both when signing (tools/image-host.c) and when
> verifying (boot/image-fit-sig.c), so the roothash and salt are
> authenticated together with the rest of the configuration.
>
> Signed-off-by: Daniel Golle <[email protected]>
> Reviewed-by: Tom Rini <[email protected]>
>
> boot/image-fit-sig.c        | 23 +++++++++++++++++++----
>  doc/usage/fit/dm-verity.rst |  5 +++++
>  doc/usage/fit/signature.rst |  2 +-
>  tools/image-host.c          | 21 +++++++++++++++++++++
>  4 files changed, 46 insertions(+), 5 deletions(-)

Reviewed-by: Simon Glass <[email protected]>

Reply via email to