{ "dataType": "CVE_RECORD", "dataVersion": "5.2", "cveMetadata": { "cveId": "CVE-2025-38349", "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "state": "PUBLISHED", "assignerShortName": "Linux", "dateReserved": "2025-04-16T04:51:24.006Z", "datePublished": "2025-07-18T07:53:16.434Z", "dateUpdated": "2026-08-05T12:01:18.098Z" }, "containers": { "cna": { "providerMetadata": { "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67", "shortName": "Linux", "dateUpdated": "2026-08-05T12:01:18.098Z" }, "descriptions": [ { "lang": "en", "value": "In the Linux kernel, the following vulnerability has been resolved:\n\neventpoll: don't decrement ep refcount while still holding the ep mutex\n\nJann Horn points out that epoll is decrementing the ep refcount and then\ndoing a\n\n mutex_unlock(&ep->mtx);\n\nafterwards. That's very wrong, because it can lead to a use-after-free.\n\nThat pattern is actually fine for the very last reference, because the\ncode in question will delay the actual call to \"ep_free(ep)\" until after\nit has unlocked the mutex.\n\nBut it's wrong for the much subtler \"next to last\" case when somebody\n*else* may also be dropping their reference and free the ep while we're\nstill using the mutex.\n\nNote that this is true even if that other user is also using the same ep\nmutex: mutexes, unlike spinlocks, can not be used for object ownership,\neven if they guarantee mutual exclusion.\n\nA mutex \"unlock\" operation is not atomic, and as one user is still\naccessing the mutex as part of unlocking it, another user can come in\nand get the now released mutex and free the data structure while the\nfirst user is still cleaning up.\n\nSee our mutex documentation in Documentation/locking/mutex-design.rst,\nin particular the section [1] about semantics:\n\n\t\"mutex_unlock() may access the mutex structure even after it has\n\t internally released the lock already - so it's not safe for\n\t another context to acquire the mutex and assume that the\n\t mutex_unlock() context is not using the structure anymore\"\n\nSo if we drop our ep ref before the mutex unlock, but we weren't the\nlast one, we may then unlock the mutex, another user comes in, drops\n_their_ reference and releases the 'ep' as it now has no users - all\nwhile the mutex_unlock() is still accessing it.\n\nFix this by simply moving the ep refcount dropping to outside the mutex:\nthe refcount itself is atomic, and doesn't need mutex protection (that's\nthe whole _point_ of refcounts: unlike mutexes, they are inherently\nabout object lifetimes)." } ], "metrics": [ { "cvssV3_1": { "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" }, "scenarios": [ { "lang": "en", "value": "AV:L - The vulnerability is reached purely through local syscalls — `epoll_create1()`/`epoll_ctl()` to build the epoll set and concurrent `close()` calls to trigger the release paths. No remote or adjacent network input is involved.\nAC:L - The attacker creates and controls both sides of the race, closing the epoll fd in one thread while closing a monitored file in another (pinnable to separate CPUs), and a lost attempt is completely benign so the race can be retried indefinitely until won.\nPR:L - Only the ability to issue ordinary syscalls as any unprivileged user is required; epoll needs no capability and is permitted even inside restrictive seccomp sandboxes and containers.\nUI:N - The attacker performs every step itself in its own threads; no victim action, mount, or file open by another user is needed.\nS:U - The corrupted `struct eventpoll` and the resulting compromise are both within the kernel of the same system, the standard local privilege-escalation scope.\nC:H - The use-after-free on a `kmalloc-256` object lets the attacker reclaim the freed `eventpoll` with a chosen object and have the racing `mutex_unlock()` dereference attacker-controlled `wait_list`/`owner` fields, yielding a read primitive usable for arbitrary kernel memory disclosure.\nI:H - The in-flight `mutex_unlock()` performs spinlock and list writes into the freed-and-reallocated object and feeds an attacker-controlled `next->task` pointer into `wake_q_add()`/`try_to_wake_up()`, giving write and control-flow-hijack primitives suitable for privilege escalation.\nA:H - Even unweaponized, the use-after-free on `ep->mtx` corrupts slab memory and reliably produces a kernel oops/panic, and it can be triggered repeatedly by any local user." } ] } ], "affected": [ { "product": "Linux", "vendor": "Linux", "defaultStatus": "unaffected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "fs/eventpoll.c" ], "versions": [ { "version": "a1f93804449d13f97dabd4b996817de4bf1ed67a", "lessThan": "b0821ec902d39062356cb644c16e17a705d1c9f5", "status": "affected", "versionType": "git" }, { "version": "58c9b016e12855286370dfb704c08498edbc857a", "lessThan": "521e9ff0b67c66a17d6f9593dfccafaa984aae4c", "status": "affected", "versionType": "git" }, { "version": "58c9b016e12855286370dfb704c08498edbc857a", "lessThan": "6dee745bd0aec9d399df674256e7b1ecdb615444", "status": "affected", "versionType": "git" }, { "version": "58c9b016e12855286370dfb704c08498edbc857a", "lessThan": "605c18698ecfa99165f36b7f59d3ed503e169814", "status": "affected", "versionType": "git" }, { "version": "58c9b016e12855286370dfb704c08498edbc857a", "lessThan": "8c2e52ebbe885c7eeaabd3b7ddcdc1246fc400d2", "status": "affected", "versionType": "git" }, { "version": "f2451def095c1743adcfcb0cb5dadc86034e162a", "status": "affected", "versionType": "git" }, { "version": "6.1.175", "lessThan": "6.1.178", "status": "affected", "versionType": "semver" }, { "version": "5.15.209", "lessThan": "5.16", "status": "affected", "versionType": "semver" } ] }, { "product": "Linux", "vendor": "Linux", "defaultStatus": "affected", "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git", "programFiles": [ "fs/eventpoll.c" ], "versions": [ { "version": "6.4", "status": "affected" }, { "version": "0", "lessThan": "6.4", "status": "unaffected", "versionType": "semver" }, { "version": "6.1.178", "lessThanOrEqual": "6.1.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.6.99", "lessThanOrEqual": "6.6.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.12.39", "lessThanOrEqual": "6.12.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.15.7", "lessThanOrEqual": "6.15.*", "status": "unaffected", "versionType": "semver" }, { "version": "6.16", "lessThanOrEqual": "*", "status": "unaffected", "versionType": "original_commit_for_fix" } ] } ], "cpeApplicability": [ { "nodes": [ { "operator": "OR", "negate": false, "cpeMatch": [ { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.1.175", "versionEndExcluding": "6.1.178" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.4", "versionEndExcluding": "6.6.99" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.4", "versionEndExcluding": "6.12.39" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.4", "versionEndExcluding": "6.15.7" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "6.4", "versionEndExcluding": "6.16" }, { "vulnerable": true, "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*", "versionStartIncluding": "5.15.209" } ] } ] } ], "references": [ { "url": "https://git.kernel.org/stable/c/b0821ec902d39062356cb644c16e17a705d1c9f5" }, { "url": "https://git.kernel.org/stable/c/521e9ff0b67c66a17d6f9593dfccafaa984aae4c" }, { "url": "https://git.kernel.org/stable/c/6dee745bd0aec9d399df674256e7b1ecdb615444" }, { "url": "https://git.kernel.org/stable/c/605c18698ecfa99165f36b7f59d3ed503e169814" }, { "url": "https://git.kernel.org/stable/c/8c2e52ebbe885c7eeaabd3b7ddcdc1246fc400d2" }, { "url": "https://project-zero.issues.chromium.org/issues/430541637" } ], "title": "eventpoll: don't decrement ep refcount while still holding the ep mutex", "x_generator": { "engine": "bippy-1.2.0" } }, "adp": [ { "metrics": [ { "other": { "type": "ssvc", "content": { "id": "CVE-2025-38349", "role": "CISA Coordinator", "options": [ { "Exploitation": "none" }, { "Automatable": "no" }, { "Technical Impact": "total" } ], "version": "2.0.3", "timestamp": "2026-06-10T20:41:09.643913Z" } } } ], "title": "CISA ADP Vulnrichment", "providerMetadata": { "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "shortName": "CISA-ADP", "dateUpdated": "2026-06-11T18:44:09.366Z" } } ] } }