In the Linux kernel, the following vulnerability has been resolved:
drm/amdgpu: Fix the memory allocation issue in amdgpudiscoverygetnpsinfo()
Fix two issues with memory allocation in amdgpudiscoverygetnpsinfo() for mem_ranges:
Add a check for allocation failure to avoid dereferencing a null pointer.
As suggested by Christophe, use kvcalloc() for memory allocation, which checks for multiplication overflow.
Additionally, assign the output parameters npstype and rangecnt after the kvcalloc() call to prevent modifying the output parameters in case of an error return.
[
    {
        "deprecated": false,
        "target": {
            "file": "drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c"
        },
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a1144da794adedb9447437c57d69add56494309d",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "159703949227008225131582690551413269941",
                "78494512992356514232700012081315478903",
                "97170952417849015061183543001513824924",
                "266113300003654348411715994329710072034",
                "143726050640533034808429957026087181944",
                "25511028013823932390281238704708113412",
                "36462986575357662750368618561229099360",
                "42602686987568576360195019176595502764",
                "56730968124110690381660104549816315068"
            ]
        },
        "id": "CVE-2024-56697-01323330",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "file": "drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c"
        },
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e8f1dbaa0437eba4e8c1d6a6d81eca2e2ce3d197",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "15005138980791834428965772427175720648",
                "191313828178908145519499092234591575155",
                "97170952417849015061183543001513824924",
                "266113300003654348411715994329710072034",
                "143726050640533034808429957026087181944",
                "25511028013823932390281238704708113412",
                "36462986575357662750368618561229099360",
                "42602686987568576360195019176595502764",
                "56730968124110690381660104549816315068"
            ]
        },
        "id": "CVE-2024-56697-627aad10",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "function": "amdgpu_discovery_get_nps_info",
            "file": "drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c"
        },
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d14bea4e094871226ea69772d69dab8b7b5f4915",
        "digest": {
            "function_hash": "169766764429198928409928161630722829380",
            "length": 1287.0
        },
        "id": "CVE-2024-56697-75e7fd9b",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "function": "amdgpu_discovery_get_nps_info",
            "file": "drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c"
        },
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a1144da794adedb9447437c57d69add56494309d",
        "digest": {
            "function_hash": "145256991781926125465268962809156149664",
            "length": 1418.0
        },
        "id": "CVE-2024-56697-88dfd78f",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "function": "amdgpu_discovery_get_nps_info",
            "file": "drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c"
        },
        "signature_type": "Function",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e8f1dbaa0437eba4e8c1d6a6d81eca2e2ce3d197",
        "digest": {
            "function_hash": "169766764429198928409928161630722829380",
            "length": 1287.0
        },
        "id": "CVE-2024-56697-dc796d13",
        "signature_version": "v1"
    },
    {
        "deprecated": false,
        "target": {
            "file": "drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c"
        },
        "signature_type": "Line",
        "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d14bea4e094871226ea69772d69dab8b7b5f4915",
        "digest": {
            "threshold": 0.9,
            "line_hashes": [
                "15005138980791834428965772427175720648",
                "191313828178908145519499092234591575155",
                "97170952417849015061183543001513824924",
                "266113300003654348411715994329710072034",
                "143726050640533034808429957026087181944",
                "25511028013823932390281238704708113412",
                "36462986575357662750368618561229099360",
                "42602686987568576360195019176595502764",
                "56730968124110690381660104549816315068"
            ]
        },
        "id": "CVE-2024-56697-ed237ef8",
        "signature_version": "v1"
    }
]