NVIDIA CUDA Driver Use-After-Free Leading to Container Escape
Overview
NVIDIA released a security bulletin detailing a critical use-after-free (UAF) vulnerability in its kernel-mode driver for CUDA. The flaw resided in the driver's handling of memory management for GPU-accelerated tasks. An unprivileged process with access to a GPU device, such as a process within a Docker container, could trigger this vulnerability by sending a specially crafted sequence of IOCTL calls to the NVIDIA device file (`/dev/nvidia*`). This manipulation leads to a state where the kernel driver deallocates a memory object but retains a dangling pointer to it. A subsequent, carefully timed IOCTL call could then cause the driver to use this invalid pointer, allowing the attacker to write controlled data to freed memory. Successful exploitation could lead to a denial of service (via a host kernel panic) or, more severely, arbitrary code execution with kernel-level privileges. In a multi-tenant cloud environment or on-premise Kubernetes cluster where GPU resources are shared, this vulnerability allows a malicious tenant to escape their container and gain full control over the host node, compromising all other containers on that machine and potentially gaining a foothold to move laterally within the network.
Affected Systems
Testing Guide
1. Check your installed NVIDIA driver version by running `nvidia-smi` on the host machine. 2. Compare the displayed driver version with the patched versions listed in the NVIDIA security bulletin. 3. An exploit PoC is available from the reporting security researchers, but running it is dangerous and should only be done in a dedicated, non-production test environment.
Mitigation Steps
1. Update NVIDIA drivers to the patched versions specified in the security bulletin (550.90.07, 535.180.05, or newer). 2. In Kubernetes environments, use security policies (e.g., Kyverno, OPA Gatekeeper) to restrict which pods can request GPU resources. 3. Employ kernel runtime security tools like Falco or Trivy to detect suspicious IOCTL calls or other anomalous behavior originating from GPU-enabled containers.
Patch Details
Patches are available in NVIDIA driver versions 550.90.07 and 535.180.05 and all subsequent releases.