Linux kernel
cpe:2.3:a:linux:linux_kernel:*:*:*:*:*:*:*, +4 more
A race condition vulnerability has been identified in the Linux kernel's memory management subsystem, specifically within the KSM (Kernel Samepage Merging) functionality. This issue arises during the iteration over virtual memory areas (VMAs) and the teardown of memory structures. The vulnerability is present in the Linux kernel stable tree. The root cause lies in the 'exit_mmap()' function, which dismantles the VMAs and the associated maple tree while holding the mmap_lock in write mode. To address this, the 'ksm_test_exit()' function should be checked after acquiring the mmap_lock in read mode, but before the 'for_each_vma()' iterator accesses a destroyed maple tree. Failing to do so could lead to a lockdep warning by dereferencing a maple tree without the necessary external lock flag.
This vulnerability can cause a race condition that disrupts the proper management of virtual memory areas, potentially leading to undefined behavior in memory handling.
The vulnerability can be reproduced by triggering the 'exit_mmap()' function while the 'for_each_vma()' iterator is active. This can be done by creating a scenario where the mmap_lock is held in write mode, allowing 'exit_mmap()' to tear down the VMAs and maple tree. After the maple tree is destroyed, the 'for_each_vma()' iterator can be used, which will dereference the destroyed maple tree without the appropriate lock, creating a lockdep warning.
Users can upgrade to the latest version of the Linux kernel where this vulnerability has been addressed.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.