Vulnerability in Kernel: disallow extremely large seq buffer allocations
Summary
GSD-2021-1001442: seq_file: disallow extremely large seq buffer allocations. Affects Kernel versions >= 058504edd02667eef8fac9be27ab3ea74332e9b4, < c5157b3e775dac31d51b11f993a06a84dc11fc8c. 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 fundamental component of the Linux operating system that manages core system functions, such as memory management, process scheduling, and device drivers. It provides an interface between the hardware and software layers, allowing applications to interact with the underlying system resources. The vulnerability in question pertains to the seq_file component of the Kernel, which is responsible for providing sequential access to data stored in kernel space. This vulnerability allows for the allocation of extremely large seq buffers, potentially leading to memory exhaustion and denial-of-service attacks.
Vulnerability Detail
The vulnerability arises from a flaw in the seq_file implementation, which fails to enforce limits on the size of seq buffers that can be allocated. An attacker could exploit this by requesting the allocation of a large seq buffer, consuming excessive memory resources and causing the system to become unresponsive or crash. The impact of this vulnerability depends on the attacker's ability to trigger the allocation of large seq buffers and the system's available resources. It is important to note that the actual impact and attack plausibility have not been proven yet.
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
As a workaround, users can apply a patch or modify the seq_file implementation to enforce limits on the size of seq buffers. Here is an example of how the code can be modified:
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -123,6 +123,10 @@ static void *seq_buf_alloc(unsigned long size)
unsigned long order = get_order(size);
void *buf;
+ if (size > MAX_SEQ_BUF_SIZE) {
+ pr_warn("seq_file: requested buffer size too large\n");
+ return NULL;
+ }
if (order > MAX_ORDER)
return NULL;
Conclusion
In conclusion, the vulnerability in the Kernel's seq_file component allows for the allocation of extremely large seq buffers, potentially leading to memory exhaustion and denial-of-service attacks. It is crucial to update the Kernel to the latest version to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The Kernel is a crucial component of the Linux operating system that manages core system functions and acts as an interface between hardware and software layers.
seq_file is a component of the Kernel that provides sequential access to data stored in kernel space.
The impact of this vulnerability depends on the attacker's ability to trigger the allocation of large seq buffers and the system's available resources. It could lead to memory exhaustion and denial-of-service attacks.
No, the actual impact and attack plausibility have not been proven yet. This vulnerability is an automated ID intended to aid in the discovery of potential security vulnerabilities.
To fix the vulnerability, users should update their Kernel to the latest version available, which includes the necessary security patches.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.