CVE-2023-52792

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-52792
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-52792.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2023-52792
Downstream
Related
Published
2024-05-21T15:31:07Z
Modified
2025-10-15T04:32:44.341758Z
Summary
cxl/region: Do not try to cleanup after cxl_region_setup_targets() fails
Details

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

cxl/region: Do not try to cleanup after cxlregionsetup_targets() fails

Commit 5e42bcbc3fef ("cxl/region: decrement ->nrtargets on error in cxlregionattach()") tried to avoid 'eiw' initialization errors when ->nrtargets exceeded 16, by just decrementing ->nrtargets when cxlregionsetuptargets() failed.

Commit 86987c766276 ("cxl/region: Cleanup target list on attach error") extended that cleanup to also clear cxled->pos and p->targets[pos]. The initialization error was incidentally fixed separately by: Commit 8d4285425714 ("cxl/region: Fix port setup uninitialized variable warnings") which was merged a few days after 5e42bcbc3fef.

But now the original cleanup when cxlregionsetup_targets() fails prevents endpoint and switch decoder resources from being reused:

1) the cleanup does not set the decoder's region to NULL, which results in future dpasizestore() calls returning -EBUSY 2) the decoder is not properly freed, which results in future commit errors associated with the upstream switch

Now that the initialization errors were fixed separately, the proper cleanup for this case is to just return immediately. Then the resources associated with this target get cleanup up as normal when the failed region is deleted.

The ->nr_targets decrement in the error case also helped prevent a p->targets[] array overflow, so add a new check to prevent against that overflow.

Tested by trying to create an invalid region for a 2 switch * 2 endpoint topology, and then following up with creating a valid region.

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
5e42bcbc3fef6e759dfb4d3f4cfb394c382b4249
Fixed
90db4c1d5ebaf574d3c3065c055977982c378a83
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5e42bcbc3fef6e759dfb4d3f4cfb394c382b4249
Fixed
9090c5537c93cd0811ab7bfbd925b57addfffb60
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5e42bcbc3fef6e759dfb4d3f4cfb394c382b4249
Fixed
07ffcd8ec79cf7383e1e45815f4842fd357991c2
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
5e42bcbc3fef6e759dfb4d3f4cfb394c382b4249
Fixed
0718588c7aaa7a1510b4de972370535b61dddd0d

Affected versions

v5.*

v5.19
v5.19-rc4
v5.19-rc5
v5.19-rc6
v5.19-rc7
v5.19-rc8

v6.*

v6.0
v6.0-rc1
v6.0-rc2
v6.0-rc3
v6.0-rc4
v6.0-rc5
v6.0-rc6
v6.0-rc7
v6.1
v6.1-rc1
v6.1-rc2
v6.1-rc3
v6.1-rc4
v6.1-rc5
v6.1-rc6
v6.1-rc7
v6.1-rc8
v6.1.1
v6.1.10
v6.1.11
v6.1.12
v6.1.13
v6.1.14
v6.1.15
v6.1.16
v6.1.17
v6.1.18
v6.1.19
v6.1.2
v6.1.20
v6.1.21
v6.1.22
v6.1.23
v6.1.24
v6.1.25
v6.1.26
v6.1.27
v6.1.28
v6.1.29
v6.1.3
v6.1.30
v6.1.31
v6.1.32
v6.1.33
v6.1.34
v6.1.35
v6.1.36
v6.1.37
v6.1.38
v6.1.39
v6.1.4
v6.1.40
v6.1.41
v6.1.42
v6.1.43
v6.1.44
v6.1.45
v6.1.46
v6.1.47
v6.1.48
v6.1.49
v6.1.5
v6.1.50
v6.1.51
v6.1.52
v6.1.53
v6.1.54
v6.1.55
v6.1.56
v6.1.57
v6.1.58
v6.1.59
v6.1.6
v6.1.60
v6.1.61
v6.1.62
v6.1.63
v6.1.7
v6.1.8
v6.1.9
v6.2
v6.2-rc1
v6.2-rc2
v6.2-rc3
v6.2-rc4
v6.2-rc5
v6.2-rc6
v6.2-rc7
v6.2-rc8
v6.3
v6.3-rc1
v6.3-rc2
v6.3-rc3
v6.3-rc4
v6.3-rc5
v6.3-rc6
v6.3-rc7
v6.4
v6.4-rc1
v6.4-rc2
v6.4-rc3
v6.4-rc4
v6.4-rc5
v6.4-rc6
v6.4-rc7
v6.5
v6.5-rc1
v6.5-rc2
v6.5-rc3
v6.5-rc4
v6.5-rc5
v6.5-rc6
v6.5-rc7
v6.5.1
v6.5.10
v6.5.11
v6.5.12
v6.5.2
v6.5.3
v6.5.4
v6.5.5
v6.5.6
v6.5.7
v6.5.8
v6.5.9
v6.6
v6.6-rc1
v6.6-rc2
v6.6-rc3
v6.6-rc4
v6.6-rc5
v6.6-rc6
v6.6-rc7
v6.6.1
v6.6.2

Database specific

{
    "vanir_signatures": [
        {
            "signature_version": "v1",
            "signature_type": "Function",
            "target": {
                "file": "drivers/cxl/core/region.c",
                "function": "cxl_region_attach"
            },
            "deprecated": false,
            "digest": {
                "length": 3288.0,
                "function_hash": "165943320437948083185159443346395062167"
            },
            "id": "CVE-2023-52792-3e29bf02",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0718588c7aaa7a1510b4de972370535b61dddd0d"
        },
        {
            "signature_version": "v1",
            "signature_type": "Line",
            "target": {
                "file": "drivers/cxl/core/region.c"
            },
            "deprecated": false,
            "digest": {
                "line_hashes": [
                    "338309743601467819447331107588873893627",
                    "40546179707126617824916762594589762986",
                    "130666761302850310095312169879975621054",
                    "326830226360759602680247759389406749535",
                    "15260416978765492115826220674040512364",
                    "67467872864217268909510301826562201517",
                    "56259169596207305598519677539625855823",
                    "274253393444860677320477760875229083344",
                    "160893765814473856098096938951911256611",
                    "319625470494188205320997271885880821922",
                    "179270010210019517714850340305127192926",
                    "258308811132821393598644258215110093263",
                    "70316364620554180341382858457560815842",
                    "97827112115470193505772466961526016943",
                    "332461905581247430844587425254812224953"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2023-52792-4273b92f",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@0718588c7aaa7a1510b4de972370535b61dddd0d"
        },
        {
            "signature_version": "v1",
            "signature_type": "Line",
            "target": {
                "file": "drivers/cxl/core/region.c"
            },
            "deprecated": false,
            "digest": {
                "line_hashes": [
                    "338309743601467819447331107588873893627",
                    "40546179707126617824916762594589762986",
                    "130666761302850310095312169879975621054",
                    "326830226360759602680247759389406749535",
                    "15260416978765492115826220674040512364",
                    "67467872864217268909510301826562201517",
                    "56259169596207305598519677539625855823",
                    "34406397699475931796832537254167863481",
                    "48465337491081037817775719399222875796",
                    "319625470494188205320997271885880821922",
                    "179270010210019517714850340305127192926",
                    "258308811132821393598644258215110093263",
                    "70316364620554180341382858457560815842",
                    "97827112115470193505772466961526016943",
                    "332461905581247430844587425254812224953"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2023-52792-65607b2a",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@07ffcd8ec79cf7383e1e45815f4842fd357991c2"
        },
        {
            "signature_version": "v1",
            "signature_type": "Function",
            "target": {
                "file": "drivers/cxl/core/region.c",
                "function": "cxl_region_attach"
            },
            "deprecated": false,
            "digest": {
                "length": 3599.0,
                "function_hash": "170994532342835505781417115622720399595"
            },
            "id": "CVE-2023-52792-6b5d3242",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9090c5537c93cd0811ab7bfbd925b57addfffb60"
        },
        {
            "signature_version": "v1",
            "signature_type": "Function",
            "target": {
                "file": "drivers/cxl/core/region.c",
                "function": "cxl_region_attach"
            },
            "deprecated": false,
            "digest": {
                "length": 2701.0,
                "function_hash": "68631649230761355827289449321288029061"
            },
            "id": "CVE-2023-52792-76b7a433",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90db4c1d5ebaf574d3c3065c055977982c378a83"
        },
        {
            "signature_version": "v1",
            "signature_type": "Function",
            "target": {
                "file": "drivers/cxl/core/region.c",
                "function": "cxl_region_attach"
            },
            "deprecated": false,
            "digest": {
                "length": 3599.0,
                "function_hash": "170994532342835505781417115622720399595"
            },
            "id": "CVE-2023-52792-79b6cd26",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@07ffcd8ec79cf7383e1e45815f4842fd357991c2"
        },
        {
            "signature_version": "v1",
            "signature_type": "Line",
            "target": {
                "file": "drivers/cxl/core/region.c"
            },
            "deprecated": false,
            "digest": {
                "line_hashes": [
                    "338309743601467819447331107588873893627",
                    "40546179707126617824916762594589762986",
                    "130666761302850310095312169879975621054",
                    "326830226360759602680247759389406749535",
                    "15260416978765492115826220674040512364",
                    "67467872864217268909510301826562201517",
                    "56259169596207305598519677539625855823",
                    "34406397699475931796832537254167863481",
                    "48465337491081037817775719399222875796",
                    "319625470494188205320997271885880821922",
                    "179270010210019517714850340305127192926",
                    "258308811132821393598644258215110093263",
                    "70316364620554180341382858457560815842",
                    "97827112115470193505772466961526016943",
                    "332461905581247430844587425254812224953"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2023-52792-ce19f820",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9090c5537c93cd0811ab7bfbd925b57addfffb60"
        },
        {
            "signature_version": "v1",
            "signature_type": "Line",
            "target": {
                "file": "drivers/cxl/core/region.c"
            },
            "deprecated": false,
            "digest": {
                "line_hashes": [
                    "338309743601467819447331107588873893627",
                    "40546179707126617824916762594589762986",
                    "130666761302850310095312169879975621054",
                    "326830226360759602680247759389406749535",
                    "15260416978765492115826220674040512364",
                    "67467872864217268909510301826562201517",
                    "56259169596207305598519677539625855823",
                    "274253393444860677320477760875229083344",
                    "160893765814473856098096938951911256611",
                    "319625470494188205320997271885880821922",
                    "179270010210019517714850340305127192926",
                    "258308811132821393598644258215110093263",
                    "70316364620554180341382858457560815842",
                    "97827112115470193505772466961526016943",
                    "332461905581247430844587425254812224953"
                ],
                "threshold": 0.9
            },
            "id": "CVE-2023-52792-e0ddc60d",
            "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@90db4c1d5ebaf574d3c3065c055977982c378a83"
        }
    ]
}

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.0.0
Fixed
6.1.64
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.5.13
Type
ECOSYSTEM
Events
Introduced
6.6.0
Fixed
6.6.3