Comment 91 for bug 1996188

Revision history for this message
Rajat Dhasmana (whoami-rajat) wrote : Re: Arbitrary file access through custom VMDK flat descriptor (CVE-2022-47951)

I've checked the victoria patch and the changes are similar to what oslo.utils does.

Here's the code change in the victoria patch:

+ if not hasattr(info, 'format_specific'):
+ qemu_info = json.loads(out)
+ info.format_specific = qemu_info.get('format-specific')

We are loading it from the qemu-img output which looks like this,

"format-specific": {
    "type": "qcow2",
    "data": {
        "compat": "1.1",
        "lazy-refcounts": false,
        "refcount-bits": 16,
        "corrupt": false
    }

Same thing oslo.utils copies into the QemuImgInfo object here

https://github.com/openstack/oslo.utils/blob/d49d5944824f15d00e04e1b9c7f8c3b03b440c95/oslo_utils/imageutils.py#L68

We also have a test added which removes the 'format_specific' attribute to check the compatibility of oslo.utils < 4.1.0.

Overall, the changes in the victoria patch looks good to me.