]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect: when dissecting block devices, ignore weird MMC RPMB partitions (#6165)
authorLennart Poettering <lennart@poettering.net>
Thu, 22 Jun 2017 15:40:50 +0000 (17:40 +0200)
committerMartin Pitt <martinpitt@users.noreply.github.com>
Thu, 22 Jun 2017 15:40:50 +0000 (17:40 +0200)
For now, let's just special-case this in the sources. If more partition
types like this show up we should probably find some other solution.

Fixes: #5806
src/shared/dissect-image.c

index 163995c1e5f5a760c20d92e2a0d023fa9335c01d..505a83f54f8f829b5a9599b89ba924f11263a7ed 100644 (file)
@@ -301,7 +301,7 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI
                 _cleanup_udev_device_unref_ struct udev_device *q;
                 unsigned long long pflags;
                 blkid_partition pp;
-                const char *node;
+                const char *node, *sysname;
                 dev_t qn;
                 int nr;
 
@@ -316,6 +316,12 @@ int dissect_image(int fd, const void *root_hash, size_t root_hash_size, DissectI
                 if (st.st_rdev == qn)
                         continue;
 
+                /* Filter out weird MMC RPMB partitions, which cannot reasonably be read, see
+                 * https://github.com/systemd/systemd/issues/5806 */
+                sysname = udev_device_get_sysname(q);
+                if (sysname && startswith(sysname, "mmcblk") && endswith(sysname, "rpmb"))
+                        continue;
+
                 node = udev_device_get_devnode(q);
                 if (!node)
                         continue;