Moderate severityNVD Advisory· Published Dec 26, 2012· Updated Apr 29, 2026
CVE-2012-5625
CVE-2012-5625
Description
OpenStack Compute (Nova) Folsom before 2012.2.2 and Grizzly, when using libvirt and LVM backed instances, does not properly clear physical volume (PV) content when reallocating for instances, which allows attackers to obtain sensitive information by reading the memory of the previous logical volume (LV).
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
novaPyPI | < 12.0.0a0 | 12.0.0a0 |
Affected products
2Patches
29d2ea9704225Don't leak info from libvirt LVM backed instances
1 file changed · +47 −0
nova/virt/libvirt/utils.py+47 −0 modified@@ -172,8 +172,55 @@ def logical_volume_info(path): return dict(zip(*info)) +def logical_volume_size(path): + """Get logical volume size in bytes. + + :param path: logical volume path + """ + # TODO(p-draigbrady) POssibly replace with the more general + # use of blockdev --getsize64 in future + out, _err = execute('lvs', '-o', 'lv_size', '--noheadings', '--units', + 'b', '--nosuffix', path, run_as_root=True) + + return int(out) + + +def clear_logical_volume(path): + """Obfuscate the logical volume. + + :param path: logical volume path + """ + # TODO(p-draigbrady): We currently overwrite with zeros + # but we may want to make this configurable in future + # for more or less security conscious setups. + + vol_size = logical_volume_size(path) + bs = 1024 * 1024 + direct_flags = ('oflag=direct',) + remaining_bytes = vol_size + + # The loop caters for versions of dd that + # don't support the iflag=count_bytes option. + while remaining_bytes: + zero_blocks = remaining_bytes / bs + seek_blocks = (vol_size - remaining_bytes) / bs + zero_cmd = ('dd', 'bs=%s' % bs, + 'if=/dev/zero', 'of=%s' % path, + 'seek=%s' % seek_blocks, 'count=%s' % zero_blocks) + zero_cmd += direct_flags + if zero_blocks: + utils.execute(*zero_cmd, run_as_root=True) + remaining_bytes %= bs + bs /= 1024 # Limit to 3 iterations + direct_flags = () # Only use O_DIRECT with initial block size + + def remove_logical_volumes(*paths): """Remove one or more logical volume.""" + + for path in paths: + clear_logical_volume(path) + if paths: lvremove = ('lvremove', '-f') + paths execute(*lvremove, attempts=3, run_as_root=True)
a99a802e008eDon't leak info from libvirt LVM backed instances
1 file changed · +44 −0
nova/virt/libvirt/utils.py+44 −0 modified@@ -149,8 +149,52 @@ def list_logical_volumes(vg): return [line.strip() for line in out.splitlines()] +def logical_volume_size(path): + """Get logical volume size in bytes. + + :param path: logical volume path + """ + # TODO(p-draigbrady) POssibly replace with the more general + # use of blockdev --getsize64 in future + out, _err = execute('lvs', '-o', 'lv_size', '--noheadings', '--units', + 'b', '--nosuffix', path, run_as_root=True) + + return int(out) + + +def clear_logical_volume(path): + """Obfuscate the logical volume. + + :param path: logical volume path + """ + # TODO(p-draigbrady): We currently overwrite with zeros + # but we may want to make this configurable in future + # for more or less security conscious setups. + + vol_size = logical_volume_size(path) + bs = 1024 * 1024 + remaining_bytes = vol_size + + # The loop caters for versions of dd that + # don't support the iflag=count_bytes option. + while remaining_bytes: + zero_blocks = remaining_bytes / bs + seek_blocks = (vol_size - remaining_bytes) / bs + zero_cmd = ('dd', 'bs=%s' % bs, + 'if=/dev/zero', 'of=%s' % path, + 'seek=%s' % seek_blocks, 'count=%s' % zero_blocks) + if zero_blocks: + utils.execute(*zero_cmd, run_as_root=True) + remaining_bytes %= bs + bs /= 1024 # Limit to 3 iterations + + def remove_logical_volumes(*paths): """Remove one or more logical volume.""" + + for path in paths: + clear_logical_volume(path) + if paths: lvremove = ('lvremove', '-f') + paths execute(*lvremove, attempts=3, run_as_root=True)
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
13- www.ubuntu.com/usn/USN-1663-1nvdPatchWEB
- github.com/openstack/nova/commit/9d2ea970422591f8cdc394001be9a2deca499a5fnvdPatchWEB
- github.com/openstack/nova/commit/a99a802e008eed18e39fc1d98170edc495cbd354nvdPatchWEB
- github.com/advisories/GHSA-rwhr-h69g-8qmqghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2012-5625ghsaADVISORY
- rhn.redhat.com/errata/RHSA-2013-0208.htmlnvdWEB
- www.openwall.com/lists/oss-security/2012/12/11/5nvdWEB
- bugs.launchpad.net/nova/+bug/1070539nvdWEB
- bugzilla.redhat.com/show_bug.cginvdWEB
- github.com/pypa/advisory-database/tree/main/vulns/nova/PYSEC-2012-41.yamlghsaWEB
- launchpad.net/nova/folsom/2012.2.2nvdWEB
- osvdb.org/88419nvd
- www.securityfocus.com/bid/56904nvd
News mentions
0No linked articles in our index yet.