Change in vdsm[master]: hsm: add untrusted image verification.

nsoffer at redhat.com nsoffer at redhat.com
Thu Apr 7 13:34:23 UTC 2016


Nir Soffer has posted comments on this change.

Change subject: hsm: add untrusted image verification.
......................................................................


Patch Set 4:

(3 comments)

https://gerrit.ovirt.org/#/c/55746/4/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:

Line 1505:     @public
Line 1506:     def verify_untrusted_volume(self, spUUID, sdUUID, imgUUID, volUUID):
Line 1507:         dom = sdCache.produce(sdUUID=sdUUID)
Line 1508:         vol = dom.produceVolume(imgUUID, volUUID)
Line 1509:         actual_info = qemuimg.info(vol.getVolumePath())
> great.
I'm fine with these names.
Line 1510: 
Line 1511:         expected_format = volume.FMT2STR[vol.getFormat()]
Line 1512:         actual_format = actual_info["format"]
Line 1513:         if expected_format != actual_format:


https://gerrit.ovirt.org/#/c/55746/5/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:

Line 1512:         actual_format = actual_info["format"]
Line 1513:         if expected_format != actual_format:
Line 1514:             raise se.ImageVerificationError(
Line 1515:                 "Uploaded image format is %s while the format specified "
Line 1516:                 "by the user is %s" % (actual_format, expected_format)
Can you convert the error message to talk about untrusted volume instead of uploaded volume?

Also do not mention "format specified by user". Vdsm does not know anything about the user and the upload image flow. Vdsm knows about having a volume with certain metadata that does not match the actual untrusted image.
Line 1517:             )
Line 1518:         if "backingfile" in actual_info:
Line 1519:             raise se.ImageVerificationError(
Line 1520:                 "'%s' is defined as a backingfile, while backingfile is not "


Line 1517:             )
Line 1518:         if "backingfile" in actual_info:
Line 1519:             raise se.ImageVerificationError(
Line 1520:                 "'%s' is defined as a backingfile, while backingfile is not "
Line 1521:                 "allowed for an uploaded image."
Same, we don't allow backing file for untrusted image.
Line 1522:                 % actual_info["backingfile"]
Line 1523:             )
Line 1524: 
Line 1525:     def validateImageMove(self, srcDom, dstDom, imgUUID):


-- 
To view, visit https://gerrit.ovirt.org/55746
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibf85061536eb4ddff021539c742a674f183a8984
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Amit Aviram <aaviram at redhat.com>
Gerrit-Reviewer: Freddy Rolland <frolland at redhat.com>
Gerrit-Reviewer: Greg Padgett <gpadgett at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list