The vulnerability allows a container to gain root access within its guest micro-VM by modifying the underlying guest root filesystem image. This is caused by the Kata Containers runtime incorrectly configuring the guest image as a writable virtio-pmem (NVDIMM) device when using the Cloud Hypervisor hypervisor.
The analysis of the patch (commit 6a672503973bf7c687053e459bfff8a9652e16bf) reveals the root cause in both the Go and Rust-based runtimes. In both implementations, logic existed to use virtio-pmem for the root filesystem. This device type, when combined with DAX (Direct Access), maps the host's image file directly into the guest's memory. The vulnerability stems from the fact that this mapping was not being configured as read-only.
Key vulnerable functions identified are:
virtcontainers.cloudHypervisor.CreateVM (Go): This function contained the logic that would choose to create a PmemConfig instead of a DiskConfig, leading to the writable device.
virtcontainers.qemuArm64.appendNvdimmImage (Go): This ARM64-specific function created an NVDIMM device without the ReadOnly flag, as the underlying QEMU version lacked support for it.
ch_config::convert::VmConfig::try_from (Rust): This function converted configuration into a PmemConfig, which was the source of the vulnerability in the Rust runtime.
hypervisor::ch::inner_hypervisor::CloudHypervisorInner::create_vm_config (Rust): This function selected virtio-pmem as the driver, triggering the vulnerable condition.
The patch remediates the issue by removing the code paths that use virtio-pmem for the root image with Cloud Hypervisor, and instead consistently uses virtio-blk-pci with a read-only disk configuration. It also disables DAX on ARM64 to prevent a related kernel panic.