From: Dusty Mabe Date: Wed, 9 Oct 2013 03:51:18 +0000 (-0400) Subject: Ignore thin pool LVM devices. X-Git-Tag: CVE-2013-4401~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4132dede0652b7f0cc83868fd454423310bc1a9c;p=thirdparty%2Flibvirt.git Ignore thin pool LVM devices. This should resolve: https://bugzilla.redhat.com/show_bug.cgi?id=924672 For BZ 924672 the problem stems from the fact that thin pool logical volume devices show up in /sbin/lvs output just like normal logical volumes do. Libvirt incorrectly assumes they are just normal logical volumes and that they will have a corresponding /dev/vgname/lvname device that has been created by udev and tries to use this device. To illustrate here is an example of the /dev/vgname/ directory and the lvs output for a normal lv, thin lv, and thin pool: LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lv vgguests -wi-a---- 1.00g pool vgguests twi-a-tz- 11.00g 0.00 thinlv vgguests Vwi-a-tz- 1.00g pool 0.00 total 0 lrwxrwxrwx. 1 root root 7 Oct 8 19:35 lv -> ../dm-7 lrwxrwxrwx. 1 root root 7 Oct 8 19:37 thinlv -> ../dm-6 This patch modifies virStorageBackendLogicalMakeVol() to ignore thin pool devices. --- diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index a1a37a1428..81ee4a4910 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -85,6 +85,14 @@ virStorageBackendLogicalMakeVol(virStoragePoolObjPtr pool, if (attrs[4] != 'a') return 0; + /* + * Skip thin pools(t). These show up in normal lvs output + * but do not have a corresponding /dev/$vg/$lv device that + * is created by udev. This breaks assumptions in later code. + */ + if (attrs[0] == 't') + return 0; + /* See if we're only looking for a specific volume */ if (data != NULL) { vol = data;