CVE-2011-4097: Integer Overflow
https://lkml.org/lkml/2011/10/31/138 An integer overflow will happen on 64bit archs if task's sum of rss, swapents and nrptes exceeds (2^31)/1000 value. This was introduced by commit f755a04 oom: use pte pages in OOM score
where the oom score computation was divided into several steps and it's no longer computed as one expression in unsigned long(rss, swapents, nrpte are unsigned long), where the result value assigned to points(int) is in range(1..1000). So there could be an int overflow while computing
176 points = 1000;
and points may have negative value. Meaning the oom score for a mem hog task will be one.
196 if (points <= 0) 197 return 1; For example: [ 3366] 0 3366 35390480 24303939 5 0 0 oom01 Out of memory: Kill process 3366 (oom01) score 1 or sacrifice child
Here the oom1 process consumes more than 24303939(rss)4096~=92GB physical memory, but it's oom score is one.
In this situation the mem hog task is skipped and oom killer kills another and most probably innocent task with oom score greater than one.
The points variable should be of type long instead of int to prevent the int overflow.
Signed-off-by: Frantisek Hrbata <fhrbata> --- mm/oomkill.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/mm/oomkill.c b/mm/oomkill.c index 626303b..e9a1785 100644 --- a/mm/oomkill.c +++ b/mm/oomkill.c @@ -162,7 +162,7 @@ static bool oomunkillabletask(struct taskstruct p, unsigned int oombadness(struct taskstruct p, struct memcgroup mem, const nodemaskt nodemask, unsigned long totalpages) { - int points; + long points; if (oomunkillabletask(p, mem, nodemask)) return 0;
Introduced by: http://git.kernel.org/linus/f755a04
Upstream commit: TBD
Acknowledgements:
Red Hat would like to thank Shubham Goyal for reporting this issue.
Other sources
Integer overflow in the oombadness function in mm/oomkill.c in the Linux kernel before 3.1.8 on 64-bit platforms allows local users to cause a denial of service (memory consumption or process termination) by using a certain large amount of memory.
— Launchpad
Affected Software
Remediation
Patch Available
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2011-4097?
CVE-2011-4097 has been assigned a medium severity due to the potential for integer overflow affecting system stability.
How do I fix CVE-2011-4097?
The recommended fix for CVE-2011-4097 is to update your Linux kernel to version 3.1.8 or later to mitigate the integer overflow issue.
Which systems are affected by CVE-2011-4097?
CVE-2011-4097 affects 64-bit Linux kernel versions prior to 3.1.8 and specific distributions like Debian and Red Hat Enterprise Linux 6.0.
What kind of vulnerability is CVE-2011-4097?
CVE-2011-4097 is an integer overflow vulnerability that occurs when the sum of a task's RSS, swapents, and nr_ptes exceeds a specific value.
What impact does CVE-2011-4097 have on systems?
CVE-2011-4097 can lead to system instability and potentially cause out-of-memory conditions due to improper handling of memory allocation.