From: Lennart Poettering Date: Thu, 9 Sep 2021 09:24:44 +0000 (+0200) Subject: dissect-image: insist that the architecture matches if both root and /usr partitions... X-Git-Tag: v250-rc1~701^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb241a69e312cbd2c027b16aae76013b1a893dba;p=thirdparty%2Fsystemd.git dissect-image: insist that the architecture matches if both root and /usr partitions are found --- diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 00ac8c69407..566c073c29a 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -1337,6 +1337,14 @@ int dissect_image( } else if (m->partitions[PARTITION_USR_SECONDARY_VERITY].found) return -EADDRNOTAVAIL; /* as above */ + /* If root and /usr are combined then insist that the architecture matches */ + if (m->partitions[PARTITION_ROOT].found && + m->partitions[PARTITION_USR].found && + (m->partitions[PARTITION_ROOT].architecture >= 0 && + m->partitions[PARTITION_USR].architecture >= 0 && + m->partitions[PARTITION_ROOT].architecture != m->partitions[PARTITION_USR].architecture)) + return -EADDRNOTAVAIL; + if (!m->partitions[PARTITION_ROOT].found && !m->partitions[PARTITION_USR].found && (flags & DISSECT_IMAGE_GENERIC_ROOT) &&