CVE-2024-50199 mm/swapfile: skip HugeTLB pages for unuse_vma
A flaw in the Linux kernel's swapoff process causes a bad PUD error and memory leak when handling HugeTLB pages, leading to denial of service.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-50199?
CVE-2024-50199 is a medium-severity vulnerability in Linux kernel, published on 8 Nov 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
mm/swapfile: skip HugeTLB pages for unuse_vma
I got a bad pud error and lost a 1GB HugeTLB when calling swapoff. The problem can be reproduced by the following steps:
1. Allocate an anonymous 1GB HugeTLB and some other anonymous memory. 2. Swapout the above anonymous memory. 3. run swapoff and we will get a bad pud error in kernel message:
mm/pgtable-generic.c:42: bad pud 00000000743d215d(84000001400000e7)
We can tell that pud_clear_bad is called by pud_none_or_clear_bad in unuse_pud_range() by ftrace. And therefore the HugeTLB pages will never be freed because we lost it from page table. We can skip HugeTLB pages for unuse_vma to fix it.
Which versions are affected by CVE-2024-50199?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-50199?
Apply the vendor's patch.
Is CVE-2024-50199 being exploited?
There is no known exploitation of CVE-2024-50199 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2024-50199, DEBIAN-CVE-2024-50199, GHSA-2jf2-9jhp-3fvx, UBUNTU-CVE-2024-50199.