CVE-2025-71074 (GCVE-0-2025-71074)

Vulnerability from cvelistv5 – Published: 2026-01-13 15:31 – Updated: 2026-08-05 12:11
VLAI
Title
functionfs: fix the open/removal races
Summary
In the Linux kernel, the following vulnerability has been resolved: functionfs: fix the open/removal races ffs_epfile_open() can race with removal, ending up with file->private_data pointing to freed object. There is a total count of opened files on functionfs (both ep0 and dynamic ones) and when it hits zero, dynamic files get removed. Unfortunately, that removal can happen while another thread is in ffs_epfile_open(), but has not incremented the count yet. In that case open will succeed, leaving us with UAF on any subsequent read() or write(). The root cause is that ffs->opened is misused; atomic_dec_and_test() vs. atomic_add_return() is not a good idea, when object remains visible all along. To untangle that * serialize openers on ffs->mutex (both for ep0 and for dynamic files) * have dynamic ones use atomic_inc_not_zero() and fail if we had zero ->opened; in that case the file we are opening is doomed. * have the inodes of dynamic files marked on removal (from the callback of simple_recursive_removal()) - clear ->i_private there. * have open of dynamic ones verify they hadn't been already removed, along with checking that state is FFS_ACTIVE.
Assigner
Impacted products
Vendor Product Version
Linux Linux Affected: ddf8abd2599491cbad959c700b90ba72a5dce8d0 , < e5bf5ee266633cb18fff6f98f0b7d59a62819eee (git)
Create a notification for this product.
Linux Linux Affected: 2.6.35
Unaffected: 0 , < 2.6.35 (semver)
Unaffected: 6.19 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_fs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "e5bf5ee266633cb18fff6f98f0b7d59a62819eee",
              "status": "affected",
              "version": "ddf8abd2599491cbad959c700b90ba72a5dce8d0",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/usb/gadget/function/f_fs.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "2.6.35"
            },
            {
              "lessThan": "2.6.35",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "6.19",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "6.19",
                  "versionStartIncluding": "2.6.35",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nfunctionfs: fix the open/removal races\n\nffs_epfile_open() can race with removal, ending up with file-\u003eprivate_data\npointing to freed object.\n\nThere is a total count of opened files on functionfs (both ep0 and\ndynamic ones) and when it hits zero, dynamic files get removed.\nUnfortunately, that removal can happen while another thread is\nin ffs_epfile_open(), but has not incremented the count yet.\nIn that case open will succeed, leaving us with UAF on any subsequent\nread() or write().\n\nThe root cause is that ffs-\u003eopened is misused; atomic_dec_and_test() vs.\natomic_add_return() is not a good idea, when object remains visible all\nalong.\n\nTo untangle that\n\t* serialize openers on ffs-\u003emutex (both for ep0 and for dynamic files)\n\t* have dynamic ones use atomic_inc_not_zero() and fail if we had\nzero -\u003eopened; in that case the file we are opening is doomed.\n\t* have the inodes of dynamic files marked on removal (from the\ncallback of simple_recursive_removal()) - clear -\u003ei_private there.\n\t* have open of dynamic ones verify they hadn\u0027t been already removed,\nalong with checking that state is FFS_ACTIVE."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The race is reached through local open, close, read, write, or ioctl operations on FunctionFS endpoint files. A USB host cannot directly invoke ffs_epfile_open(), so this is local rather than physical or network access.\nAC:L - The attacker can race opening a dynamic endpoint against closing the sole remaining ep0 descriptor and repeat the attempt with controlled threads. Both race sides and the freed allocation\u0027s endpoint-controlled size are attacker-controlled.\nPR:L - Mounting FunctionFS requires CAP_SYS_ADMIN in the initial user namespace, but endpoint opening has no capability check and uid/gid/fmode options permit delegation to non-root service accounts, as in [AOSP FunctionFS mounts](https://android.googlesource.com/device/google/gs201/%2B/587 5d29f/conf/init.gs201.usb.rc). A low-privileged local account with delegated endpoint access can therefore trigger the race.\nUI:N - The attacker independently performs endpoint configuration, concurrent open and close operations, and subsequent use of the stale descriptor without victim interaction.\nS:U - Exploitation corrupts memory within the kernel\u0027s existing security authority and constitutes ordinary local kernel compromise rather than crossing a VM or IOMMU boundary.\nC:H - The attacker-sized heap object contains numerous pointers and can be reclaimed before stale read, ioctl, or release operations, making kernel-memory disclosure through the UAF defensible.\nI:H - The stale object reaches mutex and list operations, atomic modification, xchg and kfree operations, and USB request handling, providing plausible arbitrary-write, arbitrary-free, and control-flow-hijacking primitives.\nA:H - Dereferencing the freed object, locking reclaimed mutexes, freeing attacker-influenced pointers, or triggering warnings under panic-on-warn can crash or panic the kernel."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T12:11:53.356Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/e5bf5ee266633cb18fff6f98f0b7d59a62819eee"
        }
      ],
      "title": "functionfs: fix the open/removal races",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2025-71074",
    "datePublished": "2026-01-13T15:31:27.413Z",
    "dateReserved": "2026-01-13T15:30:19.647Z",
    "dateUpdated": "2026-08-05T12:11:53.356Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2025-71074",
      "date": "2026-08-05",
      "epss": "0.001",
      "percentile": "0.00977"
    },
    "nvd": "{\"cve\":{\"id\":\"CVE-2025-71074\",\"sourceIdentifier\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"published\":\"2026-01-13T16:16:06.860\",\"lastModified\":\"2026-07-30T06:24:48.973\",\"vulnStatus\":\"Modified\",\"cveTags\":[],\"descriptions\":[{\"lang\":\"en\",\"value\":\"In the Linux kernel, the following vulnerability has been resolved:\\n\\nfunctionfs: fix the open/removal races\\n\\nffs_epfile_open() can race with removal, ending up with file-\u003eprivate_data\\npointing to freed object.\\n\\nThere is a total count of opened files on functionfs (both ep0 and\\ndynamic ones) and when it hits zero, dynamic files get removed.\\nUnfortunately, that removal can happen while another thread is\\nin ffs_epfile_open(), but has not incremented the count yet.\\nIn that case open will succeed, leaving us with UAF on any subsequent\\nread() or write().\\n\\nThe root cause is that ffs-\u003eopened is misused; atomic_dec_and_test() vs.\\natomic_add_return() is not a good idea, when object remains visible all\\nalong.\\n\\nTo untangle that\\n\\t* serialize openers on ffs-\u003emutex (both for ep0 and for dynamic files)\\n\\t* have dynamic ones use atomic_inc_not_zero() and fail if we had\\nzero -\u003eopened; in that case the file we are opening is doomed.\\n\\t* have the inodes of dynamic files marked on removal (from the\\ncallback of simple_recursive_removal()) - clear -\u003ei_private there.\\n\\t* have open of dynamic ones verify they hadn\u0027t been already removed,\\nalong with checking that state is FFS_ACTIVE.\"},{\"lang\":\"es\",\"value\":\"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad:\\n\\nfunctionfs: corregir las condiciones de carrera de apertura/eliminaci\u00f3n\\n\\nffs_epfile_open() puede entrar en condici\u00f3n de carrera con la eliminaci\u00f3n, lo que resulta en que file-\u0026gt;private_data apunte a un objeto liberado.\\n\\nExiste un recuento total de archivos abiertos en functionfs (tanto ep0 como los din\u00e1micos) y cuando llega a cero, los archivos din\u00e1micos se eliminan. Desafortunadamente, esa eliminaci\u00f3n puede ocurrir mientras otro hilo est\u00e1 en ffs_epfile_open(), pero a\u00fan no ha incrementado el recuento. En ese caso, la apertura tendr\u00e1 \u00e9xito, dej\u00e1ndonos con UAF en cualquier read() o write() posterior.\\n\\nLa causa ra\u00edz es que ffs-\u0026gt;opened se utiliza incorrectamente; atomic_dec_and_test() frente a atomic_add_return() no es una buena idea cuando el objeto permanece visible todo el tiempo.\\n\\nPara desenredar eso\\n* serializar los abridores en ffs-\u0026gt;mutex (tanto para ep0 como para archivos din\u00e1micos)\\n* hacer que los din\u00e1micos usen atomic_inc_not_zero() y fallen si ten\u00edamos cero -\u0026gt;opened; en ese caso, el archivo que estamos abriendo est\u00e1 condenado.\\n* hacer que los inodos de los archivos din\u00e1micos se marquen al eliminarse (desde la devoluci\u00f3n de llamada de simple_recursive_removal()) - borrar -\u0026gt;i_private all\u00ed.\\n* hacer que la apertura de los din\u00e1micos verifique que no hayan sido ya eliminados, junto con la comprobaci\u00f3n de que el estado es FFS_ACTIVE.\"}],\"affected\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"affectedData\":[{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"unaffected\",\"programFiles\":[\"drivers/usb/gadget/function/f_fs.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"ddf8abd2599491cbad959c700b90ba72a5dce8d0\",\"lessThan\":\"e5bf5ee266633cb18fff6f98f0b7d59a62819eee\",\"versionType\":\"git\",\"status\":\"affected\"}]},{\"vendor\":\"Linux\",\"product\":\"Linux\",\"defaultStatus\":\"affected\",\"programFiles\":[\"drivers/usb/gadget/function/f_fs.c\"],\"repo\":\"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git\",\"versions\":[{\"version\":\"2.6.35\",\"status\":\"affected\"},{\"version\":\"0\",\"lessThan\":\"2.6.35\",\"versionType\":\"semver\",\"status\":\"unaffected\"},{\"version\":\"6.19\",\"lessThanOrEqual\":\"*\",\"versionType\":\"original_commit_for_fix\",\"status\":\"unaffected\"}]}]}],\"metrics\":{\"cvssMetricV31\":[{\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"type\":\"Secondary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H\",\"baseScore\":7.8,\"baseSeverity\":\"HIGH\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"LOW\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"HIGH\",\"integrityImpact\":\"HIGH\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.8,\"impactScore\":5.9},{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"3.1\",\"vectorString\":\"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H\",\"baseScore\":4.7,\"baseSeverity\":\"MEDIUM\",\"attackVector\":\"LOCAL\",\"attackComplexity\":\"HIGH\",\"privilegesRequired\":\"LOW\",\"userInteraction\":\"NONE\",\"scope\":\"UNCHANGED\",\"confidentialityImpact\":\"NONE\",\"integrityImpact\":\"NONE\",\"availabilityImpact\":\"HIGH\"},\"exploitabilityScore\":1.0,\"impactScore\":3.6}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"CWE-362\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*\",\"versionStartIncluding\":\"2.6.35.1\",\"versionEndExcluding\":\"6.19\",\"matchCriteriaId\":\"7F5B9532-DC73-487B-B269-082C453A67EC\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:2.6.35:-:*:*:*:*:*:*\",\"matchCriteriaId\":\"11B11B98-42CE-41C8-A40E-FAA230FD2A76\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc1:*:*:*:*:*:*\",\"matchCriteriaId\":\"17B67AA7-40D6-4AFA-8459-F200F3D7CFD1\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc2:*:*:*:*:*:*\",\"matchCriteriaId\":\"C47E4CC9-C826-4FA9-B014-7FE3D9B318B2\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc3:*:*:*:*:*:*\",\"matchCriteriaId\":\"F71D92C0-C023-48BD-B3B6-70B638EEE298\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc4:*:*:*:*:*:*\",\"matchCriteriaId\":\"13580667-0A98-40CC-B29F-D12790B91BDB\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc5:*:*:*:*:*:*\",\"matchCriteriaId\":\"CAD1FED7-CF48-47BF-AC7D-7B6FA3C065FC\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc6:*:*:*:*:*:*\",\"matchCriteriaId\":\"3EF854A1-ABB1-4E93-BE9A-44569EC76C0D\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc7:*:*:*:*:*:*\",\"matchCriteriaId\":\"F5DC0CA6-F0AF-4DDF-A882-3DADB9A886A7\"},{\"vulnerable\":true,\"criteria\":\"cpe:2.3:o:linux:linux_kernel:6.19:rc8:*:*:*:*:*:*\",\"matchCriteriaId\":\"EB5B7DFC-C36B-45D8-922C-877569FDDF43\"}]}]}],\"references\":[{\"url\":\"https://git.kernel.org/stable/c/e5bf5ee266633cb18fff6f98f0b7d59a62819eee\",\"source\":\"416baaa9-dc9f-4396-8d5f-8c081fb06d67\",\"tags\":[\"Patch\"]}]}}",
    "redhat_vex": {
      "aggregate_severity": "None",
      "current_release_date": "2026-06-28T11:45:13+00:00",
      "cve": "CVE-2025-71074",
      "id": "CVE-2025-71074",
      "initial_release_date": "2025-01-01T00:00:00+00:00",
      "product_status:known_not_affected": "274",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: functionfs: fix the open/removal races",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2025/cve-2025-71074.json",
      "version": "3"
    },
    "suse_vex": {
      "aggregate_severity": "moderate",
      "current_release_date": "2026-07-31T00:56:55Z",
      "cve": "CVE-2025-71074",
      "id": "CVE-2025-71074",
      "initial_release_date": "2026-01-14T00:25:54Z",
      "product_status:known_affected": "355",
      "source": "SUSE CSAF VEX",
      "status": "interim",
      "title": "SUSE CVE CVE-2025-71074",
      "url": "https://ftp.suse.com/pub/projects/security/csaf-vex/cve-2025-71074.json",
      "version": "11"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

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…

Loading…