summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-08-10 12:32:48 -0600
committerTom Rini <[email protected]>2026-08-10 12:37:16 -0600
commit6ea67890d034c8f285dcea438dcee2e06af3921c (patch)
treee28d966945f8a2f359044c661785e9b887f55366 /include
parent28515d7ff5285e0b942f15577e3198f15c667a25 (diff)
parentfe9877c7d9dea740985edd11f7ff583e311568be (diff)
Merge patch series "boot: fit: authenticate the dm-verity roothash"
Daniel Golle <[email protected]> says: A signed FIT configuration can delegate the integrity of a (potentially large) root filesystem image to the kernel's dm-verity instead of having U-Boot hash the whole payload at boot: the FIT carries a "dm-verity" subnode with the roothash, salt and block parameters, U-Boot passes the roothash to Linux through the dm-mod.create bootargs, and dm-verity then validates the filesystem block by block against it. For that to be safe the roothash has to be trusted, and in a signed configuration the only thing that establishes trust is the configuration signature. The roothash was not covered by it. fit_config_add_hash() collected the image node, its hash subnodes and its cipher subnode into the signed region, but not the dm-verity subnode, so the roothash, the sole integrity anchor for the filesystem, was left unsigned. The result is a verified-boot bypass for the root filesystem: an attacker who can rewrite the boot medium can replace the filesystem, recompute a matching dm-verity tree, write the new roothash into the unsigned dm-verity subnode, and the configuration signature still verifies. dm-verity then faithfully validates the malicious filesystem against the attacker's roothash. This series closes the gap. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'include')
-rw-r--r--include/image.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/image.h b/include/image.h
index 4149ebbcce9..6edcb1995bf 100644
--- a/include/image.h
+++ b/include/image.h
@@ -1897,6 +1897,29 @@ struct image_region *fit_region_make_list(const void *fit,
struct fdt_region *fdt_regions, int count,
struct image_region *region);
+/**
+ * fit_config_get_signed_nodes() - Build the list of nodes covered by a config
+ * signature
+ *
+ * Collects the paths of the nodes that the configuration signature is
+ * computed over: the root node, the configuration node, and for each image
+ * referenced by the configuration its node, its hash subnodes and its cipher
+ * and dm-verity subnodes. The result is the same node list used when creating
+ * and verifying the signature, and is suitable for passing to
+ * fdt_find_regions().
+ *
+ * @fit: FIT blob
+ * @conf_noffset: Configuration node offset
+ * @node_inc: Array to fill with pointers to packed path strings
+ * @max_nodes: Number of entries in @node_inc
+ * @buf: Buffer for the packed null-terminated path strings
+ * @buf_len: Size of @buf
+ * Return: number of entries written to @node_inc, or -ve on error
+ */
+int fit_config_get_signed_nodes(const void *fit, int conf_noffset,
+ char **node_inc, int max_nodes,
+ char *buf, int buf_len);
+
static inline int fit_image_check_target_arch(const void *fdt, int node)
{
#ifndef USE_HOSTCC