mm, hugetlb: Fix simple resv_huge_pages underflow on UFFDIO_COPY in Kernel
Summary
GSD-2021-1000757: mm, hugetlb: fix simple resv_huge_pages underflow on UFFDIO_COPY. Affects Kernel versions >= 8fb5debc5fcd450470cdd789c2d80ef95ebb8cf4, < 14fd3da3e8d3de7f34d69dd4bfa5fd9e73d99911. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Kernel is a critical component of the Linux operating system that provides core functionalities and interfaces between hardware and software. It manages system resources, including memory, processes, and device drivers. The mm subsystem in the Kernel handles memory management, including the allocation and deallocation of memory pages. The hugetlb module within mm enables the use of huge pages, which are larger than the standard memory pages, for certain applications that require large memory mappings. This vulnerability affects the Kernel's handling of resv_huge_pages during UFFDIO_COPY operations.
Vulnerability Detail
The vulnerability arises from a simple resv_huge_pages underflow on UFFDIO_COPY in the mm, hugetlb module of the Kernel. This underflow can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a denial-of-service condition. The issue was introduced in version v4.11 of the Kernel and has been fixed in version v5.4.125. The vulnerability can be exploited by an attacker with local access to the system.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If updating the Kernel is not immediately feasible, a possible workaround is to disable the use of huge pages by modifying the system's configuration. This can be achieved by setting the 'vm.nr_hugepages' parameter to 0 in the '/etc/sysctl.conf' file and rebooting the system. However, this workaround may impact the performance of applications that rely on huge pages.
Conclusion
The mm, hugetlb vulnerability in the Kernel can lead to memory corruption and potential code execution or denial-of-service attacks. It is crucial to update the Kernel to version v5.4.125 or later to mitigate this vulnerability. If immediate updating is not possible, disabling the use of huge pages can serve as a temporary workaround. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The vulnerability can lead to memory corruption and potentially allow an attacker to execute arbitrary code or cause a denial-of-service condition.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Simply upload your package-lock.json file and the Vulert Playground will analyze it for any open-source vulnerabilities, including this one.
No, this vulnerability requires local access to the system in order to be exploited.
There are no known instances of this vulnerability being exploited in the wild at this time.
Disabling the use of huge pages can serve as a temporary mitigation until the Kernel is updated. However, this may impact the performance of certain applications.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.