Skip to content
Heist/ feed
Back to feed
HighFix available

orangefs: fix xattr related buffer overflow...

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: orangefs: fix xattr related buffer overflow... Willy Tarreau forwarded me a message from Disclosure with the following warning: > The helper `xattr_key()` uses the pointer variable in the loop condition > rather than dereferencing it. As `key` is incremented, it remains non-NULL > (until it runs into unmapped memory), so the loop does not terminate on > valid C strings and will walk memory indefinitely, consuming CPU or hanging > the thread. I easily reproduced this with setfattr and getfattr, causing a kernel oops, hung user processes and corrupted orangefs files. Disclosure sent along a diff (not a patch) with a suggested fix, which I based this patch on. After xattr_key started working right, xfstest generic/069 exposed an xattr related memory leak that lead to OOM. xattr_key returns a hashed key. When adding xattrs to the orangefs xattr cache, orangefs used hash_add, a kernel hashing macro. hash_add also hashes the key using hash_log which resulted in additions to the xattr cache going to the wrong hash bucket. generic/069 tortures a single file and orangefs does a getattr for the xattr "security.capability" every time. Orangefs negative caches on xattrs which includes a kmalloc. Since adds to the xattr cache were going to the wrong bucket, every getattr for "security.capability" resulted in another kmalloc, none of which were ever freed. I changed the two uses of hash_add to hlist_add_head instead and th

Products
Kernel
Affected versions
Not specified
Fixed versions
5.10.247, 5.15.197, 5.4.302, 6.1.159, 6.12.58, 6.17.8, 6.6.117
CVEs
CVE-2025-40306
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 11:52 UTC · Revision 1

Source evidence

orangefs: fix xattr related buffer overflow...

core-osv · Original source

Published 8 Dec 2025, 00:46 UTC

In the Linux kernel, the following vulnerability has been resolved: orangefs: fix xattr related buffer overflow... Willy Tarreau forwarded me a message from Disclosure with the following warning: > The helper `xattr_key()` uses the pointer variable in the loop condition > rather than dereferencing it. As `key` is incremented, it remains non-NULL > (until it runs into unmapped memory), so the loop does not terminate on > valid C strings and will walk memory indefinitely, consuming CPU or hanging > the thread. I easily reproduced this with setfattr and getfattr, causing a kernel oops, hung user processes and corrupted orangefs files. Disclosure sent along a diff (not a patch) with a suggested fix, which I based this patch on. After xattr_key started working right, xfstest generic/069 exposed an xattr related memory leak that lead to OOM. xattr_key returns a hashed key. When adding xattrs to the orangefs xattr cache, orangefs used hash_add, a kernel hashing macro. hash_add also hashes the key using hash_log which resulted in additions to the xattr cache going to the wrong hash bucket. generic/069 tortures a single file and orangefs does a getattr for the xattr "security.capability" every time. Orangefs negative caches on xattrs which includes a kmalloc. Since adds to the xattr cache were going to the wrong bucket, every getattr for "security.capability" resulted in another kmalloc, none of which were ever freed. I changed the two uses of hash_add to hlist_add_head instead and th

osv:CVE-2025-40306

Kernel

Fixed versions: 5.4.302, 5.10.247, 5.15.197, 6.1.159, 6.6.117, 6.12.58, 6.17.8

Complete source record
{
  "id": "810d3ebe110d99346def7e0a186da1f6284419a41bce0b9a406baa1a2421a65a",
  "url": "https://osv.dev/vulnerability/CVE-2025-40306",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "orangefs: fix xattr related buffer overflow...",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: orangefs: fix xattr related buffer overflow... Willy Tarreau forwarded me a message from Disclosure with the following warning: > The helper `xattr_key()` uses the pointer variable in the loop condition > rather than dereferencing it. As `key` is incremented, it remains non-NULL > (until it runs into unmapped memory), so the loop does not terminate on > valid C strings and will walk memory indefinitely, consuming CPU or hanging > the thread. I easily reproduced this with setfattr and getfattr, causing a kernel oops, hung user processes and corrupted orangefs files. Disclosure sent along a diff (not a patch) with a suggested fix, which I based this patch on. After xattr_key started working right, xfstest generic/069 exposed an xattr related memory leak that lead to OOM. xattr_key returns a hashed key. When adding xattrs to the orangefs xattr cache, orangefs used hash_add, a kernel hashing macro. hash_add also hashes the key using hash_log which resulted in additions to the xattr cache going to the wrong hash bucket. generic/069 tortures a single file and orangefs does a getattr for the xattr \"security.capability\" every time. Orangefs negative caches on xattrs which includes a kmalloc. Since adds to the xattr cache were going to the wrong bucket, every getattr for \"security.capability\" resulted in another kmalloc, none of which were ever freed. I changed the two uses of hash_add to hlist_add_head instead and th",
    "evidence": "osv:CVE-2025-40306",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "5.4.302",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.247",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.197",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.1.159",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.117",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.12.58",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.17.8",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "CVE-2025-40306",
      "aliases": [
        "CVE-2025-40306"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/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": "f7ab093f74bf638ed98fd1115f3efa17e308bb7f"
                },
                {
                  "fixed": "c6564ff6b53c9a8dc786b6f1c51ae7688273f931"
                },
                {
                  "fixed": "ef892d2bf4f3fa2c8de1677dd307e678bdd3d865"
                },
                {
                  "fixed": "15afebb9597449c444801d1ff0b8d8b311f950ab"
                },
                {
                  "fixed": "bc812574de633cf9a9ad6974490e45f6a4bb5126"
                },
                {
                  "fixed": "e09a096104fc65859422817fb2211f35855983fe"
                },
                {
                  "fixed": "9127d1e90c90e5960c8bc72a4ce2c209691a7021"
                },
                {
                  "fixed": "c2ca015ac109fd743fdde27933d59dc5ad46658e"
                },
                {
                  "fixed": "025e880759c279ec64d0f754fe65bf45961da864"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40306.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.6.0"
                },
                {
                  "fixed": "5.4.302"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.247"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.197"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "6.1.159"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.117"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.12.58"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.17.8"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40306.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:35.057635506Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/025e880759c279ec64d0f754fe65bf45961da864",
        "https://git.kernel.org/stable/c/15afebb9597449c444801d1ff0b8d8b311f950ab",
        "https://git.kernel.org/stable/c/9127d1e90c90e5960c8bc72a4ce2c209691a7021",
        "https://git.kernel.org/stable/c/bc812574de633cf9a9ad6974490e45f6a4bb5126",
        "https://git.kernel.org/stable/c/c2ca015ac109fd743fdde27933d59dc5ad46658e",
        "https://git.kernel.org/stable/c/c6564ff6b53c9a8dc786b6f1c51ae7688273f931",
        "https://git.kernel.org/stable/c/e09a096104fc65859422817fb2211f35855983fe",
        "https://git.kernel.org/stable/c/ef892d2bf4f3fa2c8de1677dd307e678bdd3d865",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40306.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2025-40306",
        "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/40xxx/CVE-2025-40306.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2025-40306",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 502154,
  "published_at": "2025-12-08T00:46:31.514+00:00"
}