Skip to content
Heist/ feed
Unrated

udmabuf: change folios array from kmalloc to kvmalloc

Type: advisorySource: Official CVE List1 source record

In the Linux kernel, the following vulnerability has been resolved: udmabuf: change folios array from kmalloc to kvmalloc 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] [ 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.

Announced Group revision 1
Original source ↗

CVE-2024-56544

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2024-56544

Linux

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Linux

Source reference: /containers/cna/affected/1/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "fbb0de795078190a9834b3409e4b009cfb18a6d4",
        "lessThan": "2384a29db79bd2cfe0b7646ac0030cb355825e29",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "fbb0de795078190a9834b3409e4b009cfb18a6d4",
        "lessThan": "2acc6192aa8570661ed37868c02c03002b1dc290",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "fbb0de795078190a9834b3409e4b009cfb18a6d4",
        "lessThan": "85bb72397cb63649fe493c96e27e1d0e4ed2ff63",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "fbb0de795078190a9834b3409e4b009cfb18a6d4",
        "lessThan": "1c0844c6184e658064e14c4335885785ad3bf84b",
        "versionType": "git"
      }
    ],
    "programFiles": [
      "drivers/dma-buf/udmabuf.c"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "4.20"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "4.20",
        "versionType": "semver"
      },
      {
        "status": "unaffected",
        "version": "6.6.160",
        "versionType": "semver",
        "lessThanOrEqual": "6.6.*"
      },
      {
        "status": "unaffected",
        "version": "6.11.11",
        "versionType": "semver",
        "lessThanOrEqual": "6.11.*"
      },
      {
        "status": "unaffected",
        "version": "6.12.2",
        "versionType": "semver",
        "lessThanOrEqual": "6.12.*"
      },
      {
        "status": "unaffected",
        "version": "6.13",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "drivers/dma-buf/udmabuf.c"
    ],
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2024-56544

Source reference: /cveMetadata/cveId

Publisher severity

No explicit severity was provided.

Event
#45924 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement