CVE-2023-52659 (GCVE-0-2023-52659)

Vulnerability from cvelistv5 – Published: 2024-05-17 12:08 – Updated: 2025-05-04 07:41
VLAI?
Title
x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type
Summary
In the Linux kernel, the following vulnerability has been resolved: x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type On 64-bit platforms, the pfn_to_kaddr() macro requires that the input value is 64 bits in order to ensure that valid address bits don't get lost when shifting that input by PAGE_SHIFT to calculate the physical address to provide a virtual address for. One such example is in pvalidate_pages() (used by SEV-SNP guests), where the GFN in the struct used for page-state change requests is a 40-bit bit-field, so attempts to pass this GFN field directly into pfn_to_kaddr() ends up causing guest crashes when dealing with addresses above the 1TB range due to the above. Fix this issue with SEV-SNP guests, as well as any similar cases that might cause issues in current/future code, by using an inline function, instead of a macro, so that the input is implicitly cast to the expected 64-bit input type prior to performing the shift operation. While it might be argued that the issue is on the caller side, other archs/macros have taken similar approaches to deal with instances like this, such as ARM explicitly casting the input to phys_addr_t: e48866647b48 ("ARM: 8396/1: use phys_addr_t in pfn_to_kaddr()") A C inline function is even better though. [ mingo: Refined the changelog some more & added __always_inline. ]
Severity ?
No CVSS data available.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: 6c3211796326a9d35618b866826ca556c8f008a8 , < 325956b0173f11e98f90462be4829a8b8b0682ce (git)
Affected: 6c3211796326a9d35618b866826ca556c8f008a8 , < 7e1471888a5e6e846e9b4d306e5327db2b58e64e (git)
Affected: 6c3211796326a9d35618b866826ca556c8f008a8 , < 814305b5c23cb815ada68d43019f39050472b25f (git)
Affected: 6c3211796326a9d35618b866826ca556c8f008a8 , < 8e5647a723c49d73b9f108a8bb38e8c29d3948ea (git)
Create a notification for this product.
    Linux Linux Affected: 6.5
Unaffected: 0 , < 6.5 (semver)
Unaffected: 6.6.23 , ≤ 6.6.* (semver)
Unaffected: 6.7.11 , ≤ 6.7.* (semver)
Unaffected: 6.8.2 , ≤ 6.8.* (semver)
Unaffected: 6.9 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2023-52659",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-21T15:56:17.694229Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:23:47.671Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-02T23:03:21.334Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/325956b0173f11e98f90462be4829a8b8b0682ce"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/7e1471888a5e6e846e9b4d306e5327db2b58e64e"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/814305b5c23cb815ada68d43019f39050472b25f"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/8e5647a723c49d73b9f108a8bb38e8c29d3948ea"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/include/asm/page.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "325956b0173f11e98f90462be4829a8b8b0682ce",
              "status": "affected",
              "version": "6c3211796326a9d35618b866826ca556c8f008a8",
              "versionType": "git"
            },
            {
              "lessThan": "7e1471888a5e6e846e9b4d306e5327db2b58e64e",
              "status": "affected",
              "version": "6c3211796326a9d35618b866826ca556c8f008a8",
              "versionType": "git"
            },
            {
              "lessThan": "814305b5c23cb815ada68d43019f39050472b25f",
              "status": "affected",
              "version": "6c3211796326a9d35618b866826ca556c8f008a8",
              "versionType": "git"
            },
            {
              "lessThan": "8e5647a723c49d73b9f108a8bb38e8c29d3948ea",
              "status": "affected",
              "version": "6c3211796326a9d35618b866826ca556c8f008a8",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "arch/x86/include/asm/page.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.5"
            },
            {
              "lessThan": "6.5",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.6.*",
              "status": "unaffected",
              "version": "6.6.23",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.7.*",
              "status": "unaffected",
              "version": "6.7.11",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.8.*",
              "status": "unaffected",
              "version": "6.8.2",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.9",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.6.23",
                  "versionStartIncluding": "6.5",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.7.11",
                  "versionStartIncluding": "6.5",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.8.2",
                  "versionStartIncluding": "6.5",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.9",
                  "versionStartIncluding": "6.5",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nx86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type\n\nOn 64-bit platforms, the pfn_to_kaddr() macro requires that the input\nvalue is 64 bits in order to ensure that valid address bits don\u0027t get\nlost when shifting that input by PAGE_SHIFT to calculate the physical\naddress to provide a virtual address for.\n\nOne such example is in pvalidate_pages() (used by SEV-SNP guests), where\nthe GFN in the struct used for page-state change requests is a 40-bit\nbit-field, so attempts to pass this GFN field directly into\npfn_to_kaddr() ends up causing guest crashes when dealing with addresses\nabove the 1TB range due to the above.\n\nFix this issue with SEV-SNP guests, as well as any similar cases that\nmight cause issues in current/future code, by using an inline function,\ninstead of a macro, so that the input is implicitly cast to the\nexpected 64-bit input type prior to performing the shift operation.\n\nWhile it might be argued that the issue is on the caller side, other\narchs/macros have taken similar approaches to deal with instances like\nthis, such as ARM explicitly casting the input to phys_addr_t:\n\n  e48866647b48 (\"ARM: 8396/1: use phys_addr_t in pfn_to_kaddr()\")\n\nA C inline function is even better though.\n\n[ mingo: Refined the changelog some more \u0026 added __always_inline. ]"
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-05-04T07:41:02.699Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/325956b0173f11e98f90462be4829a8b8b0682ce"
        },
        {
          "url": "https://git.kernel.org/stable/c/7e1471888a5e6e846e9b4d306e5327db2b58e64e"
        },
        {
          "url": "https://git.kernel.org/stable/c/814305b5c23cb815ada68d43019f39050472b25f"
        },
        {
          "url": "https://git.kernel.org/stable/c/8e5647a723c49d73b9f108a8bb38e8c29d3948ea"
        }
      ],
      "title": "x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2023-52659",
    "datePublished": "2024-05-17T12:08:36.098Z",
    "dateReserved": "2024-03-07T14:49:46.884Z",
    "dateUpdated": "2025-05-04T07:41:02.699Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "vulnrichment": {
      "containers": "{\"adp\": [{\"title\": \"CVE Program Container\", \"references\": [{\"url\": \"https://git.kernel.org/stable/c/325956b0173f11e98f90462be4829a8b8b0682ce\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/7e1471888a5e6e846e9b4d306e5327db2b58e64e\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/814305b5c23cb815ada68d43019f39050472b25f\", \"tags\": [\"x_transferred\"]}, {\"url\": \"https://git.kernel.org/stable/c/8e5647a723c49d73b9f108a8bb38e8c29d3948ea\", \"tags\": [\"x_transferred\"]}], \"providerMetadata\": {\"orgId\": \"af854a3a-2127-422b-91ae-364da2661108\", \"shortName\": \"CVE\", \"dateUpdated\": \"2024-08-02T23:03:21.334Z\"}}, {\"metrics\": [{\"other\": {\"type\": \"ssvc\", \"content\": {\"id\": \"CVE-2023-52659\", \"role\": \"CISA Coordinator\", \"options\": [{\"Exploitation\": \"none\"}, {\"Automatable\": \"no\"}, {\"Technical Impact\": \"partial\"}], \"version\": \"2.0.3\", \"timestamp\": \"2024-05-21T15:56:17.694229Z\"}}}], \"providerMetadata\": {\"orgId\": \"134c704f-9b21-4f2e-91b3-4a467353bcc0\", \"shortName\": \"CISA-ADP\", \"dateUpdated\": \"2024-05-23T19:01:25.215Z\"}, \"title\": \"CISA ADP Vulnrichment\"}], \"cna\": {\"title\": \"x86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type\", \"affected\": [{\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6c3211796326a9d35618b866826ca556c8f008a8\", \"lessThan\": \"325956b0173f11e98f90462be4829a8b8b0682ce\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6c3211796326a9d35618b866826ca556c8f008a8\", \"lessThan\": \"7e1471888a5e6e846e9b4d306e5327db2b58e64e\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6c3211796326a9d35618b866826ca556c8f008a8\", \"lessThan\": \"814305b5c23cb815ada68d43019f39050472b25f\", \"versionType\": \"git\"}, {\"status\": \"affected\", \"version\": \"6c3211796326a9d35618b866826ca556c8f008a8\", \"lessThan\": \"8e5647a723c49d73b9f108a8bb38e8c29d3948ea\", \"versionType\": \"git\"}], \"programFiles\": [\"arch/x86/include/asm/page.h\"], \"defaultStatus\": \"unaffected\"}, {\"repo\": \"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\", \"vendor\": \"Linux\", \"product\": \"Linux\", \"versions\": [{\"status\": \"affected\", \"version\": \"6.5\"}, {\"status\": \"unaffected\", \"version\": \"0\", \"lessThan\": \"6.5\", \"versionType\": \"semver\"}, {\"status\": \"unaffected\", \"version\": \"6.6.23\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.6.*\"}, {\"status\": \"unaffected\", \"version\": \"6.7.11\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.7.*\"}, {\"status\": \"unaffected\", \"version\": \"6.8.2\", \"versionType\": \"semver\", \"lessThanOrEqual\": \"6.8.*\"}, {\"status\": \"unaffected\", \"version\": \"6.9\", \"versionType\": \"original_commit_for_fix\", \"lessThanOrEqual\": \"*\"}], \"programFiles\": [\"arch/x86/include/asm/page.h\"], \"defaultStatus\": \"affected\"}], \"references\": [{\"url\": \"https://git.kernel.org/stable/c/325956b0173f11e98f90462be4829a8b8b0682ce\"}, {\"url\": \"https://git.kernel.org/stable/c/7e1471888a5e6e846e9b4d306e5327db2b58e64e\"}, {\"url\": \"https://git.kernel.org/stable/c/814305b5c23cb815ada68d43019f39050472b25f\"}, {\"url\": \"https://git.kernel.org/stable/c/8e5647a723c49d73b9f108a8bb38e8c29d3948ea\"}], \"x_generator\": {\"engine\": \"bippy-5f407fcff5a0\"}, \"descriptions\": [{\"lang\": \"en\", \"value\": \"In the Linux kernel, the following vulnerability has been resolved:\\n\\nx86/mm: Ensure input to pfn_to_kaddr() is treated as a 64-bit type\\n\\nOn 64-bit platforms, the pfn_to_kaddr() macro requires that the input\\nvalue is 64 bits in order to ensure that valid address bits don\u0027t get\\nlost when shifting that input by PAGE_SHIFT to calculate the physical\\naddress to provide a virtual address for.\\n\\nOne such example is in pvalidate_pages() (used by SEV-SNP guests), where\\nthe GFN in the struct used for page-state change requests is a 40-bit\\nbit-field, so attempts to pass this GFN field directly into\\npfn_to_kaddr() ends up causing guest crashes when dealing with addresses\\nabove the 1TB range due to the above.\\n\\nFix this issue with SEV-SNP guests, as well as any similar cases that\\nmight cause issues in current/future code, by using an inline function,\\ninstead of a macro, so that the input is implicitly cast to the\\nexpected 64-bit input type prior to performing the shift operation.\\n\\nWhile it might be argued that the issue is on the caller side, other\\narchs/macros have taken similar approaches to deal with instances like\\nthis, such as ARM explicitly casting the input to phys_addr_t:\\n\\n  e48866647b48 (\\\"ARM: 8396/1: use phys_addr_t in pfn_to_kaddr()\\\")\\n\\nA C inline function is even better though.\\n\\n[ mingo: Refined the changelog some more \u0026 added __always_inline. ]\"}], \"providerMetadata\": {\"orgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"shortName\": \"Linux\", \"dateUpdated\": \"2024-12-19T08:23:32.370Z\"}}}",
      "cveMetadata": "{\"cveId\": \"CVE-2023-52659\", \"state\": \"PUBLISHED\", \"dateUpdated\": \"2024-12-19T08:23:32.370Z\", \"dateReserved\": \"2024-03-07T14:49:46.884Z\", \"assignerOrgId\": \"416baaa9-dc9f-4396-8d5f-8c081fb06d67\", \"datePublished\": \"2024-05-17T12:08:36.098Z\", \"assignerShortName\": \"Linux\"}",
      "dataType": "CVE_RECORD",
      "dataVersion": "5.1"
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…