{"id":"CVE-2025-38584","state":"PUBLISHED","title":"padata: Fix pd UAF once and for all","description":"In the Linux kernel, the following vulnerability has been resolved:\n\npadata: Fix pd UAF once and for all\n\nThere is a race condition/UAF in padata_reorder that goes back\nto the initial commit.  A reference count is taken at the start\nof the process in padata_do_parallel, and released at the end in\npadata_serial_worker.\n\nThis reference count is (and only is) required for padata_replace\nto function correctly.  If padata_replace is never called then\nthere is no issue.\n\nIn the function padata_reorder which serves as the core of padata,\nas soon as padata is added to queue->serial.list, and the associated\nspin lock released, that padata may be processed and the reference\ncount on pd would go away.\n\nFix this by getting the next padata before the squeue->serial lock\nis released.\n\nIn order to make this possible, simplify padata_reorder by only\ncalling it once the next padata arrives.","publishedAt":"2025-08-19T17:03:06.172Z","updatedAt":"2026-10-15T22:02:26.071Z","severity":{"score":7,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"a2048e475e22b13dc3e53d485b7e6e11464ed9a6","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"73f132e60857038416540c3599b1de6033d7575a","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"609e59193fc6d9dd323f1c6ae1fdd721f1c79680","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"a11a12a9880ab37342b73c93cfe1a3ada02ff0db","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"f231d5d001ec75f5886c02d496a4c79edc383d45","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"dbe3e911a59bda6de96e7cae387ff882c2c177fa","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"cdf79bd2e1ecb3cc75631c73d8f4149be6019a52","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"71203f68c7749609d7fc8ae6ad054bdedeb24f91","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/padata.h","kernel/padata.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.34","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.34","versionType":"semver"},{"version":"5.10.258","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.209","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.175","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.140","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.86","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.10","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16.1","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/padata.h","kernel/padata.c"]}],"references":["https://git.kernel.org/stable/c/a2048e475e22b13dc3e53d485b7e6e11464ed9a6","https://git.kernel.org/stable/c/73f132e60857038416540c3599b1de6033d7575a","https://git.kernel.org/stable/c/609e59193fc6d9dd323f1c6ae1fdd721f1c79680","https://git.kernel.org/stable/c/a11a12a9880ab37342b73c93cfe1a3ada02ff0db","https://git.kernel.org/stable/c/f231d5d001ec75f5886c02d496a4c79edc383d45","https://git.kernel.org/stable/c/dbe3e911a59bda6de96e7cae387ff882c2c177fa","https://git.kernel.org/stable/c/cdf79bd2e1ecb3cc75631c73d8f4149be6019a52","https://git.kernel.org/stable/c/71203f68c7749609d7fc8ae6ad054bdedeb24f91","https://cert-portal.siemens.com/productcert/html/ssa-784472.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/38xxx/CVE-2025-38584.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-38584","state":"PUBLISHED","datePublished":"2025-08-19T17:03:06.172Z","dateUpdated":"2026-10-15T22:02:26.071Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T04:51:24.026Z"},"containers":{"cna":{"title":"padata: Fix pd UAF once and for all","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\npadata: Fix pd UAF once and for all\n\nThere is a race condition/UAF in padata_reorder that goes back\nto the initial commit.  A reference count is taken at the start\nof the process in padata_do_parallel, and released at the end in\npadata_serial_worker.\n\nThis reference count is (and only is) required for padata_replace\nto function correctly.  If padata_replace is never called then\nthere is no issue.\n\nIn the function padata_reorder which serves as the core of padata,\nas soon as padata is added to queue->serial.list, and the associated\nspin lock released, that padata may be processed and the reference\ncount on pd would go away.\n\nFix this by getting the next padata before the squeue->serial lock\nis released.\n\nIn order to make this possible, simplify padata_reorder by only\ncalling it once the next padata arrives."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"a2048e475e22b13dc3e53d485b7e6e11464ed9a6","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"73f132e60857038416540c3599b1de6033d7575a","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"609e59193fc6d9dd323f1c6ae1fdd721f1c79680","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"a11a12a9880ab37342b73c93cfe1a3ada02ff0db","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"f231d5d001ec75f5886c02d496a4c79edc383d45","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"dbe3e911a59bda6de96e7cae387ff882c2c177fa","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"cdf79bd2e1ecb3cc75631c73d8f4149be6019a52","versionType":"git"},{"version":"16295bec6398a3eedc9377e1af6ff4c71b98c300","status":"affected","lessThan":"71203f68c7749609d7fc8ae6ad054bdedeb24f91","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/padata.h","kernel/padata.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.34","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.34","versionType":"semver"},{"version":"5.10.258","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.209","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.175","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.140","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.86","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.15.10","status":"unaffected","lessThanOrEqual":"6.15.*","versionType":"semver"},{"version":"6.16.1","status":"unaffected","lessThanOrEqual":"6.16.*","versionType":"semver"},{"version":"6.17","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["include/linux/padata.h","kernel/padata.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a2048e475e22b13dc3e53d485b7e6e11464ed9a6"},{"url":"https://git.kernel.org/stable/c/73f132e60857038416540c3599b1de6033d7575a"},{"url":"https://git.kernel.org/stable/c/609e59193fc6d9dd323f1c6ae1fdd721f1c79680"},{"url":"https://git.kernel.org/stable/c/a11a12a9880ab37342b73c93cfe1a3ada02ff0db"},{"url":"https://git.kernel.org/stable/c/f231d5d001ec75f5886c02d496a4c79edc383d45"},{"url":"https://git.kernel.org/stable/c/dbe3e911a59bda6de96e7cae387ff882c2c177fa"},{"url":"https://git.kernel.org/stable/c/cdf79bd2e1ecb3cc75631c73d8f4149be6019a52"},{"url":"https://git.kernel.org/stable/c/71203f68c7749609d7fc8ae6ad054bdedeb24f91"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable padata reorder path is only driven by pcrypt AEAD requests, which an unprivileged local user submits via AF_ALG sockets (or in-kernel IPsec); the required `padata_replace()`/`padata_free_shell()` side is a local sysfs/CPU-hotplug/netlink action, so a purely remote attacker cannot set up the necessary state.\nAC:H - The attacker controls only one side of the race (the pcrypt request stream); dropping the base `pd` reference requires `padata_replace()` via root-only sysfs cpumask writes, CPU hotplug, or init-ns CAP_NET_ADMIN `crypto_del_alg` — conditions truly outside an unprivileged attacker's control, and the window between `spin_unlock(&squeue->serial.lock)` and the next `pd` dereference must coincide with the final refcount drop.\nPR:L - An unprivileged user with no capabilities can open AF_ALG sockets and flood `pcrypt(...)` requests to drive `padata_do_parallel`/`padata_do_serial` and hold the race open; no capability check exists on that path.\nUI:N - No victim action is needed — the `padata_replace()` trigger routinely occurs automatically via CPU hotplug (cloud vCPU resize, thermal/power hotplug on embedded and Android, suspend/resume offlining secondary CPUs) rather than through a human interacting with content.\nS:U - The use-after-free is on a kernel slab/percpu object and its consequences stay within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The freed `struct parallel_data` and its freed percpu `reorder_list`/`squeue` are read after free (`pd->cpu`, `pd->processed`, `reorder->lock`, list pointers), and reclaiming those allocations with attacker-sprayed objects turns the UAF into an arbitrary kernel-memory read primitive.\nI:H - After the free, `padata_reorder()` writes into the freed object (`spin_unlock_bh(&pd->lock)`, `refcount_inc()`, `list_del_init()`) and queues `&pd->reorder_work` and `&squeue->work` — work_structs inside freed memory whose `func` pointer is later invoked, giving control-flow hijack and privilege escalation once the slab is reclaimed.\nA:H - Even unexploited, the use-after-free corrupts freed slab and percpu memory, takes a spinlock in freed storage, and queues a work item with a stale function pointer, reliably producing a kernel oops/panic."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:03:10.424Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"5.10.258"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"5.15.209"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"6.1.175"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"6.6.140"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"6.12.86"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"6.15.10"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"6.16.1"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.34","versionEndExcluding":"6.17"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"affected":[{"vendor":"Siemens","product":"SIMATIC S7-1500 TM MFP - GNU/Linux subsystem","defaultStatus":"unknown","versions":[{"version":"0","status":"affected","lessThan":"*","versionType":"custom"}]}],"references":[{"url":"https://cert-portal.siemens.com/productcert/html/ssa-784472.html"}],"providerMetadata":{"shortName":"siemens-SADP","orgId":"0b142b55-0307-4c5a-b3c9-f314f3fb7c5e","dateUpdated":"2026-10-15T01:07:30.115Z"},"x_adpType":"supplier"},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2025-38584","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-10-15T21:51:57.371948Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T22:02:26.071Z"}}]}}}