lueschem / edi-boot-shim

edi-boot-shim is a small utility that helps you manage the u-boot boot configuration.
GNU Lesser General Public License v3.0
3 stars 0 forks source link

Get rid of using unit addresses in FIT dts files. #3

Closed lueschem closed 2 years ago

lueschem commented 2 years ago

https://github.com/lueschem/edi-boot-shim/blob/master/template/boot.scr.its is using unit addresses (e.g. default@1). However, due to CVE-2021-27138 u-boot does not allow this anymore: https://source.codeaurora.org/external/imx/uboot-imx/commit/common/image-fit.c?id=3f04db891a353f4b127ed57279279f851c6b4917

The reworked boot.scr.its file could then look like:

/dts-v1/;

/ {
    description = "edi-boot-shim boot script";
    #address-cells = <1>;

    images {
        default = "bootscript-1";
        bootscript-1 {
            description = "default setup";
            data = /incbin/("__BOOT_COMMAND_SCRIPT__");
            type = "script";
            arch = "__U_BOOT_ARCHITECTURE__";
            compression = "none";
            hash-1 {
                algo = "sha1";
            };
        };
    };
};

Marco, many thanks for the hint!