Information
overlay is a Linux filesystem that layers multiple filesystems to create a single unified view which allows a user to "merge" several mount points into a unified filesystem.
The overlay has known CVE's: CVE-2023-32629, CVE-2023-2640, CVE-2023-0386. Disabling the overlay 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
Run the following to unload and disable the overlay kernel module. This can also be done by running the script included below.
Run the following commands to unload the overlay kernel module:
# modprobe -r overlay 2>/dev/null
# rmmod overlay 2>/dev/null
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 '\n%s\n' "install overlay /bin/false" >> overlay.conf
Create a file ending inconf with blacklist overlay in the /etc/modprobe.d/ directory
Example:
# printf '\n%s\n' "blacklist overlay" >> 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.