Skip to content
Heist/ feed
Back to feed
UnratedFix available

lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure The kcalloc() in dmirror_device_evict_chunk() will return null if the physical memory has run out. As a result, if src_pfns 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 __GFP_NOFAIL flag in kcalloc(). Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.1.93, 6.6.33, 6.8.12, 6.9.3
CVEs
CVE-2024-38543
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 10:36 UTC · Revision 1

Source evidence

lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure

core-osv · Original source

Published 19 Jun 2024, 13:35 UTC

In the Linux kernel, the following vulnerability has been resolved: lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure The kcalloc() in dmirror_device_evict_chunk() will return null if the physical memory has run out. As a result, if src_pfns 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 __GFP_NOFAIL flag in kcalloc(). Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.

osv:CVE-2024-38543

Kernel

Fixed versions: 6.1.93, 6.6.33, 6.8.12, 6.9.3

Complete source record
{
  "id": "d3278014a43bedd09485f3a85f4942505f7250262c8fd218443965ccfb76499f",
  "url": "https://osv.dev/vulnerability/CVE-2024-38543",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure The kcalloc() in dmirror_device_evict_chunk() will return null if the physical memory has run out. As a result, if src_pfns 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 __GFP_NOFAIL flag in kcalloc(). Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.",
    "evidence": "osv:CVE-2024-38543",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.1.93",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.33",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.8.12",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.9.3",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2024-38543",
      "aliases": [
        "CVE-2024-38543"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b2ef9f5a5cb37643ca5def3516c546457074b882"
                },
                {
                  "fixed": "1a21fdeea502658e315bd939409b755974f4fb64"
                },
                {
                  "fixed": "65e528a69cb3ed4a286c45b4afba57461c8b5b33"
                },
                {
                  "fixed": "ce47e8ead9a72834cc68431d53f8092ce69bebb7"
                },
                {
                  "fixed": "3b20d18f475bd17309db640dbe7d7c7ebb5bc2bc"
                },
                {
                  "fixed": "c2af060d1c18beaec56351cf9c9bcbbc5af341a3"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-38543.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.8.0"
                },
                {
                  "fixed": "6.1.93"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.33"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.8.12"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.9.0"
                },
                {
                  "fixed": "6.9.3"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-38543.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:27.989256166Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/1a21fdeea502658e315bd939409b755974f4fb64",
        "https://git.kernel.org/stable/c/3b20d18f475bd17309db640dbe7d7c7ebb5bc2bc",
        "https://git.kernel.org/stable/c/65e528a69cb3ed4a286c45b4afba57461c8b5b33",
        "https://git.kernel.org/stable/c/c2af060d1c18beaec56351cf9c9bcbbc5af341a3",
        "https://git.kernel.org/stable/c/ce47e8ead9a72834cc68431d53f8092ce69bebb7",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/38xxx/CVE-2024-38543.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-38543",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/38xxx/CVE-2024-38543.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-38543",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 494579,
  "published_at": "2024-06-19T13:35:17.994+00:00"
}