Also export UDISKS_DM_TARGET_PARAMS for 'multipath' target
authorDavid Zeuthen <davidz@redhat.com>
Fri, 1 Oct 2010 16:02:24 +0000 (12:02 -0400)
committerDavid Zeuthen <davidz@redhat.com>
Fri, 1 Oct 2010 16:02:24 +0000 (12:02 -0400)
This is safe - no key material or similar is ever exported
cf. CVE-2010-1149. Additionally, this unbreaks multipath support, see

http://people.freedesktop.org/~david/multipath-restored.png

Signed-off-by: David Zeuthen <davidz@redhat.com>
src/device.c
src/probers/udisks-dm-export.c

index 3602f0f..91c6cd1 100644 (file)
@@ -3338,7 +3338,8 @@ update_info_partition_on_linux_dmmp (Device *device)
   targets_type = g_udev_device_get_property_as_strv (device->priv->d, "UDISKS_DM_TARGETS_TYPE");
   /* If we ever need this for other types than "linear", remember to update
      udisks-dm-export.c as well. */
-  if (targets_type == NULL || g_strcmp0 (targets_type[0], "linear") != 0)
+  if (targets_type == NULL || !(g_strcmp0 (targets_type[0], "linear") == 0 ||
+                                g_strcmp0 (targets_type[0], "multipath") == 0))
     goto out;
 
   targets_params = g_udev_device_get_property_as_strv (device->priv->d, "UDISKS_DM_TARGETS_PARAMS");
index 8fff4f9..86da709 100644 (file)
@@ -290,7 +290,9 @@ dm_export (int major, int minor)
           /* Set target_params for known-safe and known-needed target types only. In particular,
            * we must not export it for "crypto", since that would expose
            * information about the key. */
-          if (g_strcmp0 (target_type, "linear") == 0 && params != NULL && strlen (params) > 0)
+          if ((g_strcmp0 (target_type, "linear") == 0 ||
+               g_strcmp0 (target_type, "multipath") == 0)
+              && params != NULL && strlen (params) > 0)
             {
               _udev_util_encode_string (params, buf, sizeof (buf));
               g_string_append (params_str, buf);