Skip to content
Heist/ feed
Back to feed
CriticalFix available

scsi: lpfc: Fix buffer free/clear order in deferred receive path

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: scsi: lpfc: Fix buffer free/clear order in deferred receive path Fix a use-after-free window by correcting the buffer release sequence in the deferred receive path. The code freed the RQ buffer first and only then cleared the context pointer under the lock. Concurrent paths (e.g., ABTS and the repost path) also inspect and release the same pointer under the lock, so the old order could lead to double-free/UAF. Note that the repost path already uses the correct pattern: detach the pointer under the lock, then free it after dropping the lock. The deferred path should do the same.

Products
Kernel
Affected versions
Not specified
Fixed versions
5.10.243, 5.15.192, 5.4.299, 6.1.151, 6.12.46, 6.16.6, 6.6.105
CVEs
CVE-2025-39841
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 21:20 UTC · Revision 1

Source evidence

scsi: lpfc: Fix buffer free/clear order in deferred receive path

core-osv · Original source

Published 19 Sept 2025, 15:26 UTC

In the Linux kernel, the following vulnerability has been resolved: scsi: lpfc: Fix buffer free/clear order in deferred receive path Fix a use-after-free window by correcting the buffer release sequence in the deferred receive path. The code freed the RQ buffer first and only then cleared the context pointer under the lock. Concurrent paths (e.g., ABTS and the repost path) also inspect and release the same pointer under the lock, so the old order could lead to double-free/UAF. Note that the repost path already uses the correct pattern: detach the pointer under the lock, then free it after dropping the lock. The deferred path should do the same.

osv:CVE-2025-39841

Kernel

Fixed versions: 5.4.299, 5.10.243, 5.15.192, 6.1.151, 6.6.105, 6.12.46, 6.16.6

Complete source record
{
  "id": "258b2706d5a58673cfcf71264fbb8fc678cc1c6664ec4e2f68a9c3431ae378c0",
  "url": "https://osv.dev/vulnerability/CVE-2025-39841",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "scsi: lpfc: Fix buffer free/clear order in deferred receive path",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: scsi: lpfc: Fix buffer free/clear order in deferred receive path Fix a use-after-free window by correcting the buffer release sequence in the deferred receive path. The code freed the RQ buffer first and only then cleared the context pointer under the lock. Concurrent paths (e.g., ABTS and the repost path) also inspect and release the same pointer under the lock, so the old order could lead to double-free/UAF. Note that the repost path already uses the correct pattern: detach the pointer under the lock, then free it after dropping the lock. The deferred path should do the same.",
    "evidence": "osv:CVE-2025-39841",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.4.299",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.243",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.192",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.151",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.105",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.12.46",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.16.6",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "critical",
    "structured": {
      "id": "CVE-2025-39841",
      "aliases": [
        "CVE-2025-39841"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "472e146d1cf3410a898b49834500fa9e33ac41a2"
                },
                {
                  "fixed": "ab34084f42ee06a9028d67c78feafb911d33d111"
                },
                {
                  "fixed": "baa39f6ad79d372a6ce0aa639fbb2f1578479f57"
                },
                {
                  "fixed": "95b63d15fce5c54a73bbf195e1aacb5a75b128e2"
                },
                {
                  "fixed": "55658c7501467ca9ef3bd4453dd920010db8bc13"
                },
                {
                  "fixed": "d96cc9a1b57725930c60b607423759d563b4d900"
                },
                {
                  "fixed": "367cb5ffd8a8a4c85dc89f55e7fa7cc191425b11"
                },
                {
                  "fixed": "897f64b01c1249ac730329b83f4f40bab71e86c7"
                },
                {
                  "fixed": "9dba9a45c348e8460da97c450cddf70b2056deb3"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39841.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.1.0"
                },
                {
                  "fixed": "5.4.299"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.243"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.192"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.151"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.105"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.12.46"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.16.6"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-39841.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:51.608723090Z",
      "provider": "osv",
      "references": [
        "https://cert-portal.siemens.com/productcert/html/ssa-032379.html",
        "https://cert-portal.siemens.com/productcert/html/ssa-089022.html",
        "https://git.kernel.org/stable/c/367cb5ffd8a8a4c85dc89f55e7fa7cc191425b11",
        "https://git.kernel.org/stable/c/55658c7501467ca9ef3bd4453dd920010db8bc13",
        "https://git.kernel.org/stable/c/897f64b01c1249ac730329b83f4f40bab71e86c7",
        "https://git.kernel.org/stable/c/95b63d15fce5c54a73bbf195e1aacb5a75b128e2",
        "https://git.kernel.org/stable/c/9dba9a45c348e8460da97c450cddf70b2056deb3",
        "https://git.kernel.org/stable/c/ab34084f42ee06a9028d67c78feafb911d33d111",
        "https://git.kernel.org/stable/c/baa39f6ad79d372a6ce0aa639fbb2f1578479f57",
        "https://git.kernel.org/stable/c/d96cc9a1b57725930c60b607423759d563b4d900",
        "https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html",
        "https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/39xxx/CVE-2025-39841.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-39841",
        "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/2025/39xxx/CVE-2025-39841.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-39841",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 520436,
  "published_at": "2025-09-19T15:26:16.349+00:00"
}