CVE-2025-40063 (GCVE-0-2025-40063)
Vulnerability from cvelistv5
Published
2025-10-28 11:48
Modified
2025-10-28 11:48
Severity ?
Summary
In the Linux kernel, the following vulnerability has been resolved: crypto: comp - Use same definition of context alloc and free ops In commit 42d9f6c77479 ("crypto: acomp - Move scomp stream allocation code into acomp"), the crypto_acomp_streams struct was made to rely on having the alloc_ctx and free_ctx operations defined in the same order as the scomp_alg struct. But in that same commit, the alloc_ctx and free_ctx members of scomp_alg may be randomized by structure layout randomization, since they are contained in a pure ops structure (containing only function pointers). If the pointers within scomp_alg are randomized, but those in crypto_acomp_streams are not, then the order may no longer match. This fixes the problem by removing the union from scomp_alg so that both crypto_acomp_streams and scomp_alg will share the same definition of alloc_ctx and free_ctx, ensuring they will always have the same layout.
Impacted products
Vendor Product Version
Linux Linux Version: 42d9f6c774790d290c175e8775ce9f1366438098
Version: 42d9f6c774790d290c175e8775ce9f1366438098
Create a notification for this product.
Show details on NVD website


{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "crypto/842.c",
            "crypto/lz4.c",
            "crypto/lz4hc.c",
            "crypto/lzo-rle.c",
            "crypto/lzo.c",
            "drivers/crypto/nx/nx-common-powernv.c",
            "drivers/crypto/nx/nx-common-pseries.c",
            "include/crypto/internal/scompress.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "779d3b6f2d32c5f1da6163e959abe1e1ffe2945b",
              "status": "affected",
              "version": "42d9f6c774790d290c175e8775ce9f1366438098",
              "versionType": "git"
            },
            {
              "lessThan": "f75f66683ded09f7135aef2e763c245a07c8271a",
              "status": "affected",
              "version": "42d9f6c774790d290c175e8775ce9f1366438098",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "crypto/842.c",
            "crypto/lz4.c",
            "crypto/lz4hc.c",
            "crypto/lzo-rle.c",
            "crypto/lzo.c",
            "drivers/crypto/nx/nx-common-powernv.c",
            "drivers/crypto/nx/nx-common-pseries.c",
            "include/crypto/internal/scompress.h"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "6.16"
            },
            {
              "lessThan": "6.16",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "6.17.*",
              "status": "unaffected",
              "version": "6.17.3",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.18-rc1",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.17.3",
                  "versionStartIncluding": "6.16",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.18-rc1",
                  "versionStartIncluding": "6.16",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: comp - Use same definition of context alloc and free ops\n\nIn commit 42d9f6c77479 (\"crypto: acomp - Move scomp stream allocation\ncode into acomp\"), the crypto_acomp_streams struct was made to rely on\nhaving the alloc_ctx and free_ctx operations defined in the same order\nas the scomp_alg struct. But in that same commit, the alloc_ctx and\nfree_ctx members of scomp_alg may be randomized by structure layout\nrandomization, since they are contained in a pure ops structure\n(containing only function pointers). If the pointers within scomp_alg\nare randomized, but those in crypto_acomp_streams are not, then\nthe order may no longer match. This fixes the problem by removing the\nunion from scomp_alg so that both crypto_acomp_streams and scomp_alg\nwill share the same definition of alloc_ctx and free_ctx, ensuring\nthey will always have the same layout."
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2025-10-28T11:48:34.549Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/779d3b6f2d32c5f1da6163e959abe1e1ffe2945b"
        },
        {
          "url": "https://git.kernel.org/stable/c/f75f66683ded09f7135aef2e763c245a07c8271a"
        }
      ],
      "title": "crypto: comp - Use same definition of context alloc and free ops",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-40063",
    "datePublished": "2025-10-28T11:48:34.549Z",
    "dateReserved": "2025-04-16T07:20:57.159Z",
    "dateUpdated": "2025-10-28T11:48:34.549Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.1",
  "vulnerability-lookup:meta": {
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-40063\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2025-10-28T12:15:40.730\",\"lastModified\":\"2025-10-30T15:05:32.197\",\"vulnStatus\":\"Awaiting Analysis\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\ncrypto: comp - Use same definition of context alloc and free ops\\n\\nIn commit 42d9f6c77479 (\\\"crypto: acomp - Move scomp stream allocation\\ncode into acomp\\\"), the crypto_acomp_streams struct was made to rely on\\nhaving the alloc_ctx and free_ctx operations defined in the same order\\nas the scomp_alg struct. But in that same commit, the alloc_ctx and\\nfree_ctx members of scomp_alg may be randomized by structure layout\\nrandomization, since they are contained in a pure ops structure\\n(containing only function pointers). If the pointers within scomp_alg\\nare randomized, but those in crypto_acomp_streams are not, then\\nthe order may no longer match. This fixes the problem by removing the\\nunion from scomp_alg so that both crypto_acomp_streams and scomp_alg\\nwill share the same definition of alloc_ctx and free_ctx, ensuring\\nthey will always have the same layout.\"}],\"metrics\":{},\"references\":[{\"url\":\"https://git.kernel.org/stable/c/779d3b6f2d32c5f1da6163e959abe1e1ffe2945b\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"},{\"url\":\"https://git.kernel.org/stable/c/f75f66683ded09f7135aef2e763c245a07c8271a\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\"}]}}"
  }
}


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 seen somewhere by the user.
  • Confirmed: The vulnerability is confirmed from an analyst perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
  • Patched: This vulnerability was successfully patched by the user reporting the sighting.
  • Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
  • Not confirmed: The user expresses doubt about the veracity of the vulnerability.
  • Not patched: This vulnerability was not successfully patched by the user reporting the sighting.


Loading…

Loading…