Vulnerability · Published May 30, 2024 · Assigned by Linux
CVE-2024-36028mm/hugetlb: fix DEBUG_LOCKS_WARN_ON(1) when dissolve_free_hugetlb_folio()
Medium 4.7
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 8% 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/hugetlb: fix DEBUG_LOCKS_WARN_ON(1) when dissolve_free_hugetlb_folio() When I did memory failure tests recently, below warning occurs: DEBUG_LOCKS_WARN_ON(1) WARNING: CPU: 8 PID: 1011 at kernel/locking/lockdep.c:232 __lock_acquire+0xccb/0x1ca0 Modules linked in: mce_inject hwpoison_inject CPU: 8 PID: 1011 Comm: bash Kdump: loaded Not tainted 6.9.0-rc3-next-20240410-00012-gdb69f219f4be #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:__lock_acquire+0xccb/0x1ca0 RSP: 0018:ffffa7a1c7fe3bd0 EFLAGS: 00000082 RAX: 0000000000000000 RBX: eb851eb853975fcf RCX: ffffa1ce5fc1c9c8 RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffffa1ce5fc1c9c0 RBP: ffffa1c6865d3280 R08: ffffffffb0f570a8 R09: 0000000000009ffb R10: 0000000000000286 R11: ffffffffb0f2ad50 R12: ffffa1c6865d3d10 R13: ffffa1c6865d3c70 R14: 0000000000000000 R15: 0000000000000004 FS: 00007ff9f32aa740(0000) GS:ffffa1ce5fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff9f3134ba0 CR3: 00000008484e4000 CR4: 00000000000006f0 Call Trace: <TASK> lock_acquire+0xbe/0x2d0 _raw_spin_lock_irqsave+0x3a/0x60 hugepage_subpool_put_pages.part.0+0xe/0xc0 free_huge_folio+0x253/0x3f0 dissolve_free_huge_page+0x147/0x210 __page_handle_poison+0x9/0x70 memory_failure+0x4e6/0x8c0 hard_offline_page_store+0x55/0xa0 kernfs_fop_write_iter+0x12c/0x1d0 vfs_write+0x380/0x540 ksys_write+0x64/0xe0 do_syscall_64+0xbc/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff9f3114887 RSP: 002b:00007ffecbacb458 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007ff9f3114887 RDX: 000000000000000c RSI: 0000564494164e10 RDI: 0000000000000001 RBP: 0000564494164e10 R08: 00007ff9f31d1460 R09: 000000007fffffff R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000c R13: 00007ff9f321b780 R14: 00007ff9f3217600 R15: 00007ff9f3216a00 </TASK> Kernel panic - not syncing: kernel: panic_on_warn set ... CPU: 8 PID: 1011 Comm: bash Kdump: loaded Not tainted 6.9.0-rc3-next-20240410-00012-gdb69f219f4be #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> panic+0x326/0x350 check_panic_on_warn+0x4f/0x50 __warn+0x98/0x190 report_bug+0x18e/0x1a0 handle_bug+0x3d/0x70 exc_invalid_op+0x18/0x70 asm_exc_invalid_op+0x1a/0x20 RIP: 0010:__lock_acquire+0xccb/0x1ca0 RSP: 0018:ffffa7a1c7fe3bd0 EFLAGS: 00000082 RAX: 0000000000000000 RBX: eb851eb853975fcf RCX: ffffa1ce5fc1c9c8 RDX: 00000000ffffffd8 RSI: 0000000000000027 RDI: ffffa1ce5fc1c9c0 RBP: ffffa1c6865d3280 R08: ffffffffb0f570a8 R09: 0000000000009ffb R10: 0000000000000286 R11: ffffffffb0f2ad50 R12: ffffa1c6865d3d10 R13: ffffa1c6865d3c70 R14: 0000000000000000 R15: 0000000000000004 lock_acquire+0xbe/0x2d0 _raw_spin_lock_irqsave+0x3a/0x60 hugepage_subpool_put_pages.part.0+0xe/0xc0 free_huge_folio+0x253/0x3f0 dissolve_free_huge_page+0x147/0x210 __page_handle_poison+0x9/0x70 memory_failure+0x4e6/0x8c0 hard_offline_page_store+0x55/0xa0 kernfs_fop_write_iter+0x12c/0x1d0 vfs_write+0x380/0x540 ksys_write+0x64/0xe0 do_syscall_64+0xbc/0x1d0 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff9f3114887 RSP: 002b:00007ffecbacb458 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007ff9f3114887 RDX: 000000000000000c RSI: 0000564494164e10 RDI: 0000000000000001 RBP: 0000564494164e10 R08: 00007ff9f31d1460 R09: 000000007fffffff R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000c R13: 00007ff9f321b780 R14: 00007ff9f3217600 R15: 00007ff9f3216a00 </TASK> After git bisecting and digging into the code, I believe the root cause is that _deferred_list field of folio is unioned with _hugetlb_subpool field. In __update_and_free_hugetlb_folio(), folio->_deferred_ ---truncated---
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.94-1 | DEBIAN-CVE-2024-36028 |
| Debian:13 | linux | 6.8.9-1 | DEBIAN-CVE-2024-36028 |
| Debian:14 | linux | 6.8.9-1 | DEBIAN-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux | 6.8.0-40.40 | USN-6949-1 |
| Ubuntu:24.04:LTS | linux | 6.8.0-40.40 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1013.14 | USN-6949-1 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1013.14 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1013.14~22.04.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1012.14 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1012.14~22.04.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1012.13 | USN-6949-1 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1012.13 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1012.13~22.04.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1008.11 | USN-6949-1 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1008.11 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-40.40~22.04.3 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1010.10 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1010.10 | USN-6949-1 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-40.40.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-40.40.1 | USN-6949-2 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-40.40.1~22.04.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1011.11 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1011.11 | USN-6949-1 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1011.11~22.04.1 | USN-6949-1 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1011.11~22.04.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1011.11.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1010.10 | USN-6955-1 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1010.10 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1010.10 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1010.10~22.04.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1009.10 | USN-6949-2 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1009.10 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-40.40.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-40.40.1~22.04.1 | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-36028 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-36028 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 1b4ce2952b4f33e198d5e993acff0611dff1e399 – before 2effe407f7563add41750fd7e03da4ea44b9809932c877191e022b55fe3a374f3d7e9fb5741c514d – before 7e0a322877416e8c648819a8e441cf8c790b2cce32c877191e022b55fe3a374f3d7e9fb5741c514d – before 9c9b32d46afab2d911897914181c48895401230032c877191e022b55fe3a374f3d7e9fb5741c514d – before 52ccdde16b6540abe43b6f8d8e1e1ec90b0983af9a1a43a0e7e96911eaa00ad20b20f2edefb31d8a6.1.47 – before 6.1.916.4.11 – before 6.5 |
| Linux | Linux | 6.5 |