CVE-2024-56712

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-56712
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-56712.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-56712
Downstream
Related
Published
2024-12-29T08:48:46Z
Modified
2025-10-17T19:03:24.509643Z
Severity
  • 3.3 (Low) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L CVSS Calculator
Summary
udmabuf: fix memory leak on last export_udmabuf() error path
Details

In the Linux kernel, the following vulnerability has been resolved:

udmabuf: fix memory leak on last export_udmabuf() error path

In exportudmabuf(), if dmabuffd() fails because the FD table is full, a dmabuf owning the udmabuf has already been created; but the error handling in udmabufcreate() will tear down the udmabuf without doing anything about the containing dmabuf.

This leaves a dma_buf in memory that contains a dangling pointer; though that doesn't seem to lead to anything bad except a memory leak.

Fix it by moving the dmabuffd() call out of export_udmabuf() so that we can give it different error handling.

Note that the shape of this code changed a lot in commit 5e72b2b41a21 ("udmabuf: convert udmabuf driver to use folios"); but the memory leak seems to have existed since the introduction of udmabuf.

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fbb0de795078190a9834b3409e4b009cfb18a6d4
Fixed
c9fc8428d4255c2128da9c4d5cd92e554d0150cf
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fbb0de795078190a9834b3409e4b009cfb18a6d4
Fixed
f49856f525acd5bef52ae28b7da2e001bbe7439e

Affected versions

v4.*

v4.19
v4.19-rc2
v4.19-rc3
v4.19-rc4
v4.19-rc5
v4.19-rc6
v4.19-rc7
v4.19-rc8
v4.20
v4.20-rc1
v4.20-rc2
v4.20-rc3
v4.20-rc4
v4.20-rc5
v4.20-rc6
v4.20-rc7

v5.*

v5.0
v5.0-rc1
v5.0-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5
v6.5-rc1
v6.5-rc2
v6.5-rc3
v6.5-rc4
v6.5-rc5
v6.5-rc6
v6.5-rc7
v6.6
v6.6-rc1
v6.6-rc2
v6.6-rc3
v6.6-rc4
v6.6-rc5
v6.6-rc6
v6.6-rc7
v6.7
v6.7-rc1
v6.7-rc2
v6.7-rc3
v6.7-rc4
v6.7-rc5
v6.7-rc6
v6.7-rc7
v6.7-rc8
v6.8
v6.8-rc1
v6.8-rc2
v6.8-rc3
v6.8-rc4
v6.8-rc5
v6.8-rc6
v6.8-rc7
v6.9
v6.9-rc1
v6.9-rc2
v6.9-rc3
v6.9-rc4
v6.9-rc5
v6.9-rc6
v6.9-rc7

Database specific

vanir_signatures

[
    {
        "id": "CVE-2024-56712-0d967f68",
        "target": {
            "file": "drivers/dma-buf/udmabuf.c"
        },
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f49856f525acd5bef52ae28b7da2e001bbe7439e",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "136427771967511190343469394067471167352",
                "318474682849467405467384683462578836453",
                "48198684478032034344233748886369551885",
                "240218149160062167341968715035974612426",
                "3726133120331953338416602562489702316",
                "331286286710860806744105934357437696822",
                "195737056653314270436904172758261790682",
                "194738379437107011498449104209962743656",
                "331456071710087329664166712335076756210",
                "251907666777353278698795139411939910524",
                "163529032775890385854443405703926515809",
                "44497126890649216053537188973980736258",
                "120099392105475173002369397264938659725",
                "37194805807914527226401730596312893322",
                "76187622697404539963217175951469899028",
                "309001699450301485542118230249620130567",
                "250129296195448228650342258320050214679",
                "44943166896192603390343058306439361401",
                "175461050616981318633708948165202839042",
                "219026932552397318188415356161625883303",
                "81106228602405177293423862775689370656",
                "15316512577201772418620189449686157427",
                "295194179720333430651726486499868272009",
                "32495156720389270145247680502088080401",
                "105509666832630769906359814670628571324",
                "104799936497375047124891679242011379063"
            ]
        },
        "deprecated": false,
        "signature_version": "v1"
    },
    {
        "id": "CVE-2024-56712-42cec7d9",
        "target": {
            "file": "drivers/dma-buf/udmabuf.c"
        },
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9fc8428d4255c2128da9c4d5cd92e554d0150cf",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "136427771967511190343469394067471167352",
                "318474682849467405467384683462578836453",
                "48198684478032034344233748886369551885",
                "240218149160062167341968715035974612426",
                "3726133120331953338416602562489702316",
                "331286286710860806744105934357437696822",
                "195737056653314270436904172758261790682",
                "194738379437107011498449104209962743656",
                "331456071710087329664166712335076756210",
                "251907666777353278698795139411939910524",
                "163529032775890385854443405703926515809",
                "44497126890649216053537188973980736258",
                "120099392105475173002369397264938659725",
                "37194805807914527226401730596312893322",
                "76187622697404539963217175951469899028",
                "71869507509897484598315697188318395520",
                "180911017062876869402183682107514073366",
                "1413849763438939682109139608938643609",
                "175461050616981318633708948165202839042",
                "219026932552397318188415356161625883303",
                "81106228602405177293423862775689370656",
                "15316512577201772418620189449686157427",
                "295194179720333430651726486499868272009",
                "334194004477399163913714990089527479160",
                "12570412197296439906867888619066810002",
                "236470354260473272509664701184943963564"
            ]
        },
        "deprecated": false,
        "signature_version": "v1"
    },
    {
        "id": "CVE-2024-56712-8849fd45",
        "target": {
            "function": "udmabuf_create",
            "file": "drivers/dma-buf/udmabuf.c"
        },
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f49856f525acd5bef52ae28b7da2e001bbe7439e",
        "digest": {
            "function_hash": "340200958851157011904607553482162506019",
            "length": 1496.0
        },
        "deprecated": false,
        "signature_version": "v1"
    },
    {
        "id": "CVE-2024-56712-8ace86fb",
        "target": {
            "function": "export_udmabuf",
            "file": "drivers/dma-buf/udmabuf.c"
        },
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9fc8428d4255c2128da9c4d5cd92e554d0150cf",
        "digest": {
            "function_hash": "272093603852744312893490016610279961262",
            "length": 392.0
        },
        "deprecated": false,
        "signature_version": "v1"
    },
    {
        "id": "CVE-2024-56712-c900ed16",
        "target": {
            "function": "udmabuf_create",
            "file": "drivers/dma-buf/udmabuf.c"
        },
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9fc8428d4255c2128da9c4d5cd92e554d0150cf",
        "digest": {
            "function_hash": "295054873216120953881915587509855752240",
            "length": 1459.0
        },
        "deprecated": false,
        "signature_version": "v1"
    },
    {
        "id": "CVE-2024-56712-e8d14b1a",
        "target": {
            "function": "export_udmabuf",
            "file": "drivers/dma-buf/udmabuf.c"
        },
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f49856f525acd5bef52ae28b7da2e001bbe7439e",
        "digest": {
            "function_hash": "272093603852744312893490016610279961262",
            "length": 392.0
        },
        "deprecated": false,
        "signature_version": "v1"
    }
]

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.20.0
Fixed
6.12.7