Information
The Linux overlay kernel module, commonly referred to as Overlayfs, is a union mount filesystem. It allows the user to overlay one file system on top of another, and creates a single, unified view.
The overlay kernel module has known CVE's: CVE-2023-32629, CVE-2023-2640, and CVE-2023-0386. Disabling the overlay kernel module reduces the local attack surface by removing support for unnecessary filesystem types and mitigates potential risks associated with unauthorized execution of setuid files, enhancing the overall system security.
Solution
Unload and disable the overlay kernel module.
- Run the following commands to unload the overlay kernel module:
# modprobe -r overlay 2>/dev/null
# rmmod overlay 2>/dev/null <xhtml:ol start="2"> - Perform the following to disable the overlay kernel module:
Create a file ending inconf with install overlay /bin/false in the /etc/modprobe.d/ directory
Example:
# printf '%s\n' "" "install overlay /bin/false" >> /etc/modprobe.d/60-overlay.conf
Create a file ending inconf with blacklist overlay in the /etc/modprobe.d/ directory
Example:
# printf '%s\n' "" "blacklist overlay" >> /etc/modprobe.d/60-overlay.conf
Impact:
WARNING: If Container applications such as Docker, Kubernetes, Podman, Linux Containers (LXC), etc. are in use proceed with caution and consider the impact on containerized workloads, as disabling the overlay may severely disrupt containerization.