KASAN Page Tag Setting Vulnerability in Linux Kernel
Summary
GSD-2022-1000617: mm, kasan: use compare-exchange operation to set KASAN page tag. Affects Kernel versions >= 2813b9c0296259fb11e75c839bab2d958ba4f96c, < dd22253c13d2795c566f52c30f1dba48d51c482d. 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 Linux Kernel is a widely used open-source operating system kernel that serves as the foundation for various Linux distributions. It provides essential functionality for managing system resources, including memory management. One of the features in the Linux Kernel is the Kernel Address Sanitizer (KASAN), which is a dynamic memory error detector. KASAN helps identify and report memory access bugs, such as out-of-bounds reads and writes. However, a vulnerability has been discovered in the KASAN page tag setting mechanism.
Vulnerability Detail
The KASAN page tag setting vulnerability in the Linux Kernel allows an attacker to manipulate the KASAN page tag without proper synchronization. This vulnerability arises from the use of a non-atomic operation to set the page tag, which can lead to race conditions. By exploiting this vulnerability, an attacker may be able to bypass or manipulate KASAN's memory error detection, potentially leading to memory corruption or other security issues. The vulnerability was introduced in version v5.0 of the Linux Kernel and was fixed in version v5.16.5.
How To Fix
No fixed version is published for this vulnerability.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.16.5 or later. This update includes the commit dd22253c13d2795c566f52c30f1dba48d51c482d, which addresses the issue by using a compare-exchange operation to set the KASAN page tag, ensuring proper synchronization and preventing race conditions.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a workaround, users can apply the patch provided in the commit dd22253c13d2795c566f52c30f1dba48d51c482d manually. Here is an example of the code change:
- set_page_tag(page, tag);
+ atomic_long_cmpxchg(&page->flags, tag, tag);
Conclusion
The KASAN Page Tag Setting Vulnerability in the Linux Kernel can potentially allow attackers to manipulate the KASAN page tag, bypassing or manipulating the memory error detection mechanism. It is crucial to update the Linux Kernel to version v5.16.5 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
This vulnerability can potentially allow an attacker to bypass or manipulate the KASAN memory error detection mechanism, leading to memory corruption or other security issues.
You can use the Vulert Playground at Vulert Scanner to check if your Linux Kernel version is affected by this vulnerability. Simply upload your package-lock.json file and the Vulert Playground will provide real-time alerts for open-source vulnerabilities.
Yes, a workaround is available. Users can manually apply the patch provided in the commit dd22253c13d2795c566f52c30f1dba48d51c482d to address the vulnerability.
The vulnerability was introduced in version v5.0 of the Linux Kernel and was fixed in version v5.16.5. Therefore, versions between v5.0 and v5.16.4 are affected.
You can find more information about this vulnerability in the GSD-2022-1000617 JSON report available at https://github.com/cloudsecurityalliance/gsd-database/blob/main/2022/1000xxx/GSD-2022-1000617.json.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.
Follow Vulert in Google
Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.