]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
bootstd: rauc: Fix null pointer access while checking root part
authorMartin Schwan <m.schwan@phytec.de>
Wed, 11 Feb 2026 08:36:22 +0000 (09:36 +0100)
committerTom Rini <trini@konsulko.com>
Mon, 16 Feb 2026 17:52:01 +0000 (11:52 -0600)
Fix a segmentation fault caused by a null pointer access during root
partition checking. The function part_get_info() was falsely given null
for the disk_partition struct, which later resulted in accessing a null
pointer and thus undefined behavior.

Fixes: 5d7c080ae5dc ("bootstd: rauc: Don't check root part filesystem")
Signed-off-by: Martin Schwan <m.schwan@phytec.de>
boot/bootmeth_rauc.c

index 432d170e00627d2f697fcdc08149aba369dccc74..d7b0c686ffe821f90f3f6c0e914bfd4e9d11bc0b 100644 (file)
@@ -97,6 +97,7 @@ static int distro_rauc_scan_parts(struct bootflow *bflow)
 {
        struct blk_desc *desc;
        struct distro_rauc_priv *priv;
+       struct disk_partition fs_info;
        char *boot_order;
        const char **boot_order_list;
        bool slot_found = false;
@@ -123,7 +124,7 @@ static int distro_rauc_scan_parts(struct bootflow *bflow)
                        if (ret)
                                continue;
                        fs_close();
-                       ret = part_get_info(desc, slot->root_part, NULL);
+                       ret = part_get_info(desc, slot->root_part, &fs_info);
                        if (ret)
                                continue;
                        slot_found = true;