config: Allow enable_iommu pod annotation by default

Since #902 the `io.katacontainers.config.hypervisor` pod annotations
have only been permitted if explicitly allowed in the global
configuration.  The default global configuration allows no such
annotations.  That's important because several of those annotations
would cause Kata to execute arbitrary binaries, and so were wildly
unsafe.

However, this is inconvenient for the
`io.katacontainers.config.hypervisor.enable_iommu` annotation
specifically, which controls whether the sandbox VM includes a vIOMMU.
A guest side vIOMMU is necessary to implement VFIO passthrough devices
with `vfio_mode = vfio`, so enabling that mode of operation currently
requires a global configuration change, and can't just be enabled
per-pod.

Unlike some of the other hypervisor annotations, the `enable_iommu`
annotation is quite safe.  By default the vIOMMU is not present, so
allowing a user to override it for a pod only improves their
facilities for isolation.  Even if the global default were changed to
enable the vIOMMU, that doesn't compel the guest kernel to use it, so
allowing a user to disable the vIOMMU doesn't materially affect
isolation either.

Therefore, allow the io.katacontainers.config.hypervisor.enable_iommu
annotation to work in the default configurations.

fixes #4330

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2022-05-28 11:45:06 +10:00
parent 430da47215
commit 8f10e13e07

View File

@ -160,7 +160,7 @@ DEFMEMSZ := 2048
DEFMEMSLOTS := 10 DEFMEMSLOTS := 10
#Default number of bridges #Default number of bridges
DEFBRIDGES := 1 DEFBRIDGES := 1
DEFENABLEANNOTATIONS := [] DEFENABLEANNOTATIONS := [\"enable_iommu\"]
DEFDISABLEGUESTSECCOMP := true DEFDISABLEGUESTSECCOMP := true
DEFDISABLEGUESTEMPTYDIR := false DEFDISABLEGUESTEMPTYDIR := false
#Default experimental features enabled #Default experimental features enabled