Skip to content

Commit b8a3d56

Browse files
kk7dsElod Illes
authored andcommitted
Check images with format_inspector for safety
It has been asserted that we should not be calling qemu-img info on untrusted files. That means we need to know if they have a backing_file, data_file or other unsafe configuration *before* we use qemu-img to probe or convert them. This grafts glance's format_inspector module into nova/images so we can use it to check the file early for safety. The expectation is that this will be moved to oslo.utils (or something) later and thus we will just delete the file from nova and change our import when that happens. NOTE: This includes whitespace changes from the glance version of format_inspector.py because of autopep8 demands. Conflicts: nova/conf/workarounds.py NOTE(elod.illes): conflict is due to the following patch that is only present in zed: Iab92124b5776a799c7f90d07281d28fcf191c8fe Change-Id: Iaefbe41b4c4bf0cf95d8f621653fdf65062aaa59 Closes-Bug: #2059809 (cherry picked from commit 9cdce71) (cherry picked from commit f07fa55) (cherry picked from commit 0acf5ee) (cherry picked from commit 67e5376) (cherry picked from commit da352ed)
1 parent f844c8f commit b8a3d56

File tree

5 files changed

+1121
-9
lines changed

5 files changed

+1121
-9
lines changed

nova/conf/workarounds.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,16 @@
416416
help="""
417417
When this is enabled, it will skip version-checking of hypervisors
418418
during live migration.
419+
"""),
420+
cfg.BoolOpt(
421+
'disable_deep_image_inspection',
422+
default=False,
423+
help="""
424+
This disables the additional deep image inspection that the compute node does
425+
when downloading from glance. This includes backing-file, data-file, and
426+
known-features detection *before* passing the image to qemu-img. Generally,
427+
this inspection should be enabled for maximum safety, but this workaround
428+
option allows disabling it if there is a compatibility concern.
419429
"""),
420430
]
421431

0 commit comments

Comments
 (0)