Vulnerability · Published Jul 5, 2024 · Assigned by Linux
CVE-2024-39474mm/vmalloc: fix vmalloc which may return null if called with __GFP_NOFAIL
Medium 5.5
In plain English
A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 13% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: mm/vmalloc: fix vmalloc which may return null if called with __GFP_NOFAIL commit a421ef303008 ("mm: allow !GFP_KERNEL allocations for kvmalloc") includes support for __GFP_NOFAIL, but it presents a conflict with commit dd544141b9eb ("vmalloc: back off when the current task is OOM-killed"). A possible scenario is as follows: process-a __vmalloc_node_range(GFP_KERNEL | __GFP_NOFAIL) __vmalloc_area_node() vm_area_alloc_pages() --> oom-killer send SIGKILL to process-a if (fatal_signal_pending(current)) break; --> return NULL; To fix this, do not check fatal_signal_pending() in vm_area_alloc_pages() if __GFP_NOFAIL set. This issue occurred during OPLUS KASAN TEST. Below is part of the log -> oom-killer sends signal to process [65731.222840] [ T1308] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/apps/uid_10198,task=gs.intelligence,pid=32454,uid=10198 [65731.259685] [T32454] Call trace: [65731.259698] [T32454] dump_backtrace+0xf4/0x118 [65731.259734] [T32454] show_stack+0x18/0x24 [65731.259756] [T32454] dump_stack_lvl+0x60/0x7c [65731.259781] [T32454] dump_stack+0x18/0x38 [65731.259800] [T32454] mrdump_common_die+0x250/0x39c [mrdump] [65731.259936] [T32454] ipanic_die+0x20/0x34 [mrdump] [65731.260019] [T32454] atomic_notifier_call_chain+0xb4/0xfc [65731.260047] [T32454] notify_die+0x114/0x198 [65731.260073] [T32454] die+0xf4/0x5b4 [65731.260098] [T32454] die_kernel_fault+0x80/0x98 [65731.260124] [T32454] __do_kernel_fault+0x160/0x2a8 [65731.260146] [T32454] do_bad_area+0x68/0x148 [65731.260174] [T32454] do_mem_abort+0x151c/0x1b34 [65731.260204] [T32454] el1_abort+0x3c/0x5c [65731.260227] [T32454] el1h_64_sync_handler+0x54/0x90 [65731.260248] [T32454] el1h_64_sync+0x68/0x6c [65731.260269] [T32454] z_erofs_decompress_queue+0x7f0/0x2258 --> be->decompressed_pages = kvcalloc(be->nr_pages, sizeof(struct page *), GFP_KERNEL | __GFP_NOFAIL); kernel panic by NULL pointer dereference. erofs assume kvmalloc with __GFP_NOFAIL never return NULL. [65731.260293] [T32454] z_erofs_runqueue+0xf30/0x104c [65731.260314] [T32454] z_erofs_readahead+0x4f0/0x968 [65731.260339] [T32454] read_pages+0x170/0xadc [65731.260364] [T32454] page_cache_ra_unbounded+0x874/0xf30 [65731.260388] [T32454] page_cache_ra_order+0x24c/0x714 [65731.260411] [T32454] filemap_fault+0xbf0/0x1a74 [65731.260437] [T32454] __do_fault+0xd0/0x33c [65731.260462] [T32454] handle_mm_fault+0xf74/0x3fe0 [65731.260486] [T32454] do_mem_abort+0x54c/0x1b34 [65731.260509] [T32454] el0_da+0x44/0x94 [65731.260531] [T32454] el0t_64_sync_handler+0x98/0xb4 [65731.260553] [T32454] el0t_64_sync+0x198/0x19c
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.99-1 | DEBIAN-CVE-2024-39474 |
| Debian:12 | linux | 6.1.99-1 | DSA-5731-1 |
| Debian:13 | linux | 6.9.7-1 | DEBIAN-CVE-2024-39474 |
| Debian:14 | linux | 6.9.7-1 | DEBIAN-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux | 6.8.0-44.44 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1015.16 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1015.16~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1014.16 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1014.16~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1014.16 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1014.16~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1010.13 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-45.45~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1012.12 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-44.44.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-44.44.1~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1013.14 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1013.14~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1013.14.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1012.12 | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1012.12 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1012.12~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1011.12 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-44.44.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-44.44.1~22.04.1 | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-39474 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-39474 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 9376130c390a76fac2788a5d6e1a149017b4ab50 – before 198a80833e3421d4c9820a4ae907120adf598c919376130c390a76fac2788a5d6e1a149017b4ab50 – before c55d3564ad25ce87ab7cc6af251f9574faebd8da9376130c390a76fac2788a5d6e1a149017b4ab50 – before 758678b65164b2158fc1de411092191cb3c394d49376130c390a76fac2788a5d6e1a149017b4ab50 – before 8e0545c83d672750632f46e3f9ad95c48c91a0fc |
| Linux | Linux | 5.17 |
References
- https://git.kernel.org/stable/c/198a80833e3421d4c9820a4ae907120adf598c91
- https://git.kernel.org/stable/c/c55d3564ad25ce87ab7cc6af251f9574faebd8da
- https://git.kernel.org/stable/c/758678b65164b2158fc1de411092191cb3c394d4
- https://git.kernel.org/stable/c/8e0545c83d672750632f46e3f9ad95c48c91a0fc
- https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html