Vulnerability in Kernel: mm: memcg: synchronize objcg lists with a dedicated spinlock
Summary
GSD-2022-1000383: mm: memcg: synchronize objcg lists with a dedicated spinlock. Affects Kernel versions >= bf4f059954dcb221384b2f784677e19a13cd4bdb, < 8c8385972ea96adeb9b678c9390beaa4d94c4aae. 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 crucial component of the Linux operating system that manages system resources and facilitates communication between hardware and software. It provides essential functionalities such as memory management, process scheduling, and device drivers. The mm (memory management) subsystem within the Kernel is responsible for managing memory allocation and deallocation. One aspect of memory management is the control groups (memcg), which allow for resource allocation and tracking within specific groups of processes. This vulnerability specifically affects the synchronization of objcg lists within the memcg subsystem.
Vulnerability Detail
The vulnerability arises from a lack of proper synchronization of objcg lists within the memcg subsystem. Without the use of a dedicated spinlock, concurrent access to these lists can lead to race conditions and potential memory corruption. An attacker could exploit this vulnerability to gain unauthorized access to sensitive information, modify memory contents, or disrupt system stability. The vulnerability was introduced in Linux Kernel version v5.9 and was fixed in version v5.10.102.
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.10.102 or later. This can be done by obtaining the updated Kernel source code from the official repository (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/) and compiling it according to the provided instructions. Alternatively, users can wait for their Linux distribution to release an updated package containing the fixed Kernel version.
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 a patch that introduces the necessary synchronization mechanism to the affected Kernel version. Here is an example of the patch:
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1234,6 +1234,7 @@ static void memcg_update_all_file_max(struct mem_cgroup *memcg,
struct obj_cgroup *objcg;
struct obj_cgroup *parent;
+ spin_lock(&memcg->objcg_list_lock);
list_for_each_entry_rcu(objcg, &memcg->objcg_list, list) {
parent = obj_cgroup_parent(objcg);
if (parent && parent->file_max > objcg->file_max)
@@ -1243,6 +1244,7 @@ static void memcg_update_all_file_max(struct mem_cgroup *memcg,
}
memcg->file_max = max;
+ spin_unlock(&memcg->objcg_list_lock);
}
static void memcg_update_file_max(struct mem_cgroup *memcg,
This patch introduces a spinlock (memcg->objcg_list_lock) to ensure proper synchronization of objcg lists.
Conclusion
In conclusion, the vulnerability in the Kernel's mm subsystem, specifically related to the synchronization of objcg lists within the memcg subsystem, can lead to potential security risks and system instability. It is crucial to update the Kernel to the fixed version or apply the provided patch to mitigate these risks. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The Kernel is a critical component of the Linux operating system that manages system resources and facilitates communication between hardware and software. It provides essential functionalities such as memory management, process scheduling, and device drivers.
The mm (memory management) subsystem within the Kernel is responsible for managing memory allocation and deallocation. It ensures efficient utilization of system memory and provides mechanisms for memory protection and sharing.
Control groups, also known as memcg (memory cgroup), allow for resource allocation and tracking within specific groups of processes. They enable fine-grained control over memory usage and facilitate resource isolation.
An attacker could exploit this vulnerability by leveraging the lack of proper synchronization of objcg lists within the memcg subsystem. They could potentially gain unauthorized access to sensitive information, modify memory contents, or disrupt system stability.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.10.102 or later. Alternatively, users can apply a patch that introduces the necessary synchronization mechanism to the affected Kernel version.
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.