udmabuf: change folios array from kmalloc to kvmalloc
Published Dec 27, 2024
5.5
MEDIUMCVSS 3.1
EPSS 0.22%
Description
When PAGE_SIZE 4096, MAX_PAGE_ORDER 10, 64bit machine, page_alloc only support 4MB. If above this, trigger this warn and return NULL.
udmabuf can change size limit, if change it to 3072(3GB), and then alloc 3GB udmabuf, will fail create.
[ 4080.876581] ------------[ cut here ]------------ [ 4080.876843] WARNING: CPU: 3 PID: 2015 at mm/page_alloc.c:4556 __alloc_pages+0x2c8/0x350 [ 4080.878839] RIP: 0010:__alloc_pages+0x2c8/0x350 [ 4080.879470] Call Trace: [ 4080.879473] <TASK> [ 4080.879473] ? __alloc_pages+0x2c8/0x350 [ 4080.879475] ? __warn.cold+0x8e/0xe8 [ 4080.880647] ? __alloc_pages+0x2c8/0x350 [ 4080.880909] ? report_bug+0xff/0x140 [ 4080.881175] ? handle_bug+0x3c/0x80 [ 4080.881556] ? exc_invalid_op+0x17/0x70 [ 4080.881559] ? asm_exc_invalid_op+0x1a/0x20 [ 4080.882077] ? udmabuf_create+0x131/0x400
Because MAX_PAGE_ORDER, kmalloc can max alloc 4096 * (1 << 10), 4MB memory, each array entry is pointer(8byte), so can save 524288 pages(2GB).
Further more, costly order(order 3) may not be guaranteed that it can be applied for, due to fragmentation.
This patch change udmabuf array use kvmalloc_array, this can fallback alloc into vmalloc, which can guarantee allocation for any size and does not affect the performance of kmalloc allocations.
Affected products
-
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version StatusaffectedConstraints
- Version
-
- Version 4.20StatusaffectedConstraints-
- Version 0StatusunaffectedConstraints<4.20
- Version 6.11.11StatusunaffectedConstraints<=6.11.*
- Version 6.12.2StatusunaffectedConstraints<=6.12.*
- Version 6.13StatusunaffectedConstraints<=*
- Version
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
- ≥ 4.20 · < 6.11.11
- ≥ 6.12 · < 6.12.2
No data.
Red Hat Enterprise Linux 9
kernel-0:5.14.0-570.12.1.el9_6
Fixed · RHSA-2025:6966
Red Hat Enterprise Linux 9
kernel-0:5.14.0-570.12.1.el9_6
Fixed · RHSA-2025:6966
Red Hat Enterprise Linux 6
kernel
Not affected
Red Hat Enterprise Linux 7
kernel
Not affected
Red Hat Enterprise Linux 7
kernel-rt
Not affected
Red Hat Enterprise Linux 8
kernel
Not affected
Red Hat Enterprise Linux 8
kernel-rt
Not affected
Red Hat Enterprise Linux 9
kernel-rt
Will not fix
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-570.12.1.el9_6 | Fixed | RHSA-2025:6966 |
| Red Hat Enterprise Linux 9 | kernel-0:5.14.0-570.12.1.el9_6 | Fixed | RHSA-2025:6966 |
| Red Hat Enterprise Linux 6 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 7 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel | Not affected | n/a |
| Red Hat Enterprise Linux 8 | kernel-rt | Not affected | n/a |
| Red Hat Enterprise Linux 9 | kernel-rt | Will not fix | n/a |
No package ranges for this CVE.
Remediation
No remediation recorded yet.
References (9)
- https://access.redhat.com/security/cve/CVE-2024-56544 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=2334428 Issue Tracking
- https://euvd.enisa.europa.eu/vulnerability/EUVD-2024-53192 Advisory
- https://git.kernel.org/stable/c/1c0844c6184e658064e14c4335885785ad3bf84b Patch
- https://git.kernel.org/stable/c/2acc6192aa8570661ed37868c02c03002b1dc290 Patch
- https://git.kernel.org/stable/c/85bb72397cb63649fe493c96e27e1d0e4ed2ff63 Patch
- https://lore.kernel.org/linux-cve-announce/2024122728-CVE-2024-56544-42cf@gregkh/T
- https://nvd.nist.gov/vuln/detail/CVE-2024-56544
- https://www.cve.org/CVERecord?id=CVE-2024-56544
Change history (0)
No recorded changes yet.