In the Linux kernel, the following vulnerability has been resolved:
lib/testhmm.c: handle srcpfns and dst_pfns allocation failure
The kcalloc() in dmirrordeviceevictchunk() will return null if the physical memory has run out. As a result, if srcpfns or dst_pfns is dereferenced, the null pointer dereference bug will happen.
Moreover, the device is going away. If the kcalloc() fails, the pages mapping a chunk could not be evicted. So add a _GFPNOFAIL flag in kcalloc().
Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.
{ "vanir_signatures": [ { "target": { "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-1812ef2b", "digest": { "threshold": 0.9, "line_hashes": [ "54297623313599677980196844191015403944", "329470228294569701934738161508840784365", "255084185976078464956865529428990617698", "37424157980265462019395293169050803371", "185667054452716887954108822360791614705", "262831297862056047516442558932529891282", "189540069312518251608825112009496940938", "205457116770054350401044999159621241345", "165928567168890685620284087028484314351", "188659076264862217100662858733014438324" ] }, "signature_version": "v1", "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3b20d18f475bd17309db640dbe7d7c7ebb5bc2bc" }, { "target": { "function": "dmirror_device_evict_chunk", "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-20a60a9b", "digest": { "length": 1011.0, "function_hash": "113408752020212335672926792250620552281" }, "signature_version": "v1", "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ce47e8ead9a72834cc68431d53f8092ce69bebb7" }, { "target": { "function": "dmirror_device_evict_chunk", "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-3cd347e7", "digest": { "length": 1011.0, "function_hash": "113408752020212335672926792250620552281" }, "signature_version": "v1", "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1a21fdeea502658e315bd939409b755974f4fb64" }, { "target": { "function": "dmirror_device_evict_chunk", "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-555e1591", "digest": { "length": 1011.0, "function_hash": "113408752020212335672926792250620552281" }, "signature_version": "v1", "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2af060d1c18beaec56351cf9c9bcbbc5af341a3" }, { "target": { "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-6ed8390c", "digest": { "threshold": 0.9, "line_hashes": [ "54297623313599677980196844191015403944", "329470228294569701934738161508840784365", "255084185976078464956865529428990617698", "37424157980265462019395293169050803371", "185667054452716887954108822360791614705", "262831297862056047516442558932529891282", "189540069312518251608825112009496940938", "205457116770054350401044999159621241345", "165928567168890685620284087028484314351", "188659076264862217100662858733014438324" ] }, "signature_version": "v1", "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65e528a69cb3ed4a286c45b4afba57461c8b5b33" }, { "target": { "function": "dmirror_device_evict_chunk", "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-823642ff", "digest": { "length": 1011.0, "function_hash": "113408752020212335672926792250620552281" }, "signature_version": "v1", "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@65e528a69cb3ed4a286c45b4afba57461c8b5b33" }, { "target": { "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-95db7846", "digest": { "threshold": 0.9, "line_hashes": [ "54297623313599677980196844191015403944", "329470228294569701934738161508840784365", "255084185976078464956865529428990617698", "37424157980265462019395293169050803371", "185667054452716887954108822360791614705", "262831297862056047516442558932529891282", "189540069312518251608825112009496940938", "205457116770054350401044999159621241345", "165928567168890685620284087028484314351", "188659076264862217100662858733014438324" ] }, "signature_version": "v1", "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ce47e8ead9a72834cc68431d53f8092ce69bebb7" }, { "target": { "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-9c8d2d7e", "digest": { "threshold": 0.9, "line_hashes": [ "54297623313599677980196844191015403944", "329470228294569701934738161508840784365", "255084185976078464956865529428990617698", "37424157980265462019395293169050803371", "185667054452716887954108822360791614705", "262831297862056047516442558932529891282", "189540069312518251608825112009496940938", "205457116770054350401044999159621241345", "165928567168890685620284087028484314351", "188659076264862217100662858733014438324" ] }, "signature_version": "v1", "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2af060d1c18beaec56351cf9c9bcbbc5af341a3" }, { "target": { "function": "dmirror_device_evict_chunk", "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-a75f6add", "digest": { "length": 1011.0, "function_hash": "113408752020212335672926792250620552281" }, "signature_version": "v1", "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3b20d18f475bd17309db640dbe7d7c7ebb5bc2bc" }, { "target": { "file": "lib/test_hmm.c" }, "deprecated": false, "id": "CVE-2024-38543-b78b8822", "digest": { "threshold": 0.9, "line_hashes": [ "54297623313599677980196844191015403944", "329470228294569701934738161508840784365", "255084185976078464956865529428990617698", "37424157980265462019395293169050803371", "185667054452716887954108822360791614705", "262831297862056047516442558932529891282", "189540069312518251608825112009496940938", "205457116770054350401044999159621241345", "165928567168890685620284087028484314351", "188659076264862217100662858733014438324" ] }, "signature_version": "v1", "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1a21fdeea502658e315bd939409b755974f4fb64" } ] }