{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-39966","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2025-04-16T07:20:57.149Z","datePublished":"2025-10-15T07:55:50.843Z","dateUpdated":"2026-08-05T12:06:35.257Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:06:35.257Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\niommufd: Fix race during abort for file descriptors\n\nfput() doesn't actually call file_operations release() synchronously, it\nputs the file on a work queue and it will be released eventually.\n\nThis is normally fine, except for iommufd the file and the iommufd_object\nare tied to gether. The file has the object as it's private_data and holds\na users refcount, while the object is expected to remain alive as long as\nthe file is.\n\nWhen the allocation of a new object aborts before installing the file it\nwill fput() the file and then go on to immediately kfree() the obj. This\ncauses a UAF once the workqueue completes the fput() and tries to\ndecrement the users refcount.\n\nFix this by putting the core code in charge of the file lifetime, and call\n__fput_sync() during abort to ensure that release() is called before\nkfree. __fput_sync() is a bit too tricky to open code in all the object\nimplementations. Instead the objects tell the core code where the file\npointer is and the core will take care of the life cycle.\n\nIf the object is successfully allocated then the file will hold a users\nrefcount and the iommufd_object cannot be destroyed.\n\nIt is worth noting that close(); ioctl(IOMMU_DESTROY); doesn't have an\nissue because close() is already using a synchronous version of fput().\n\nThe UAF looks like this:\n\n    BUG: KASAN: slab-use-after-free in iommufd_eventq_fops_release+0x45/0xc0 drivers/iommu/iommufd/eventq.c:376\n    Write of size 4 at addr ffff888059c97804 by task syz.0.46/6164\n\n    CPU: 0 UID: 0 PID: 6164 Comm: syz.0.46 Not tainted syzkaller #0 PREEMPT(full)\n    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025\n    Call Trace:\n     <TASK>\n     __dump_stack lib/dump_stack.c:94 [inline]\n     dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120\n     print_address_description mm/kasan/report.c:378 [inline]\n     print_report+0xcd/0x630 mm/kasan/report.c:482\n     kasan_report+0xe0/0x110 mm/kasan/report.c:595\n     check_region_inline mm/kasan/generic.c:183 [inline]\n     kasan_check_range+0x100/0x1b0 mm/kasan/generic.c:189\n     instrument_atomic_read_write include/linux/instrumented.h:96 [inline]\n     atomic_fetch_sub_release include/linux/atomic/atomic-instrumented.h:400 [inline]\n     __refcount_dec include/linux/refcount.h:455 [inline]\n     refcount_dec include/linux/refcount.h:476 [inline]\n     iommufd_eventq_fops_release+0x45/0xc0 drivers/iommu/iommufd/eventq.c:376\n     __fput+0x402/0xb70 fs/file_table.c:468\n     task_work_run+0x14d/0x240 kernel/task_work.c:227\n     resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]\n     exit_to_user_mode_loop+0xeb/0x110 kernel/entry/common.c:43\n     exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]\n     syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]\n     syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]\n     do_syscall_64+0x41c/0x4c0 arch/x86/entry/syscall_64.c:100\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f"}],"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 through `ioctl(IOMMU_FAULT_QUEUE_ALLOC)` / `IOMMU_VEVENTQ_ALLOC` on an open iommufd character device (`/dev/iommu` or `/dev/vfio/vfio`). This requires local access to the system; there is no network-facing path to iommufd.\nAC:L - The abort path is triggered deterministically by the attacker — supply a read-only ioctl argument buffer so `iommufd_ucmd_respond()`'s `copy_to_user()` fails, or set a low `RLIMIT_NOFILE` so `get_unused_fd_flags()` fails — and the deferred-`fput()`-after-`kfree()` ordering then always holds. The attacker also controls the reallocation side by spraying from sibling threads, so no condition lies outside their influence.\nPR:L - No capability check exists anywhere on the path; `IOMMU_FAULT_QUEUE_ALLOC` needs only an open iommufd fd and no attached device, and `/dev/vfio/vfio` is registered with mode 0666 (world-writable) whenever `CONFIG_IOMMUFD_VFIO_CONTAINER` is enabled, giving any unprivileged local user the full iommufd command set.\nUI:N - The attacker performs the entire sequence — open the device, issue the ioctl with a faulting buffer, spray — within their own process. No victim action of any kind is involved.\nS:U - The defect corrupts the kernel's own heap and object refcounting inside iommufd's control plane; it does not bypass IOMMU translation or escape a DMA/virtualization protection domain. The vulnerable and impacted components are both the host kernel, so the security authority is unchanged.\nC:H - The use-after-free lets the attacker reallocate the freed `iommufd_eventq` with controlled data, and `iommufd_ctx_put(eventq->ictx)` then dereferences an attacker-supplied pointer from that memory, providing the pointer-chasing primitive needed to disclose arbitrary kernel memory.\nI:H - The freed object is written after free (`refcount_dec(&eventq->obj.users)`) at a fixed offset in a sprayable kmalloc slab, and `fput()` is invoked on an attacker-influenced pointer — refcount underflow plus a controlled `struct file` release are classic stepping stones to arbitrary write and local privilege escalation.\nA:H - Even without successful heap grooming the use-after-free writes into freed slab memory and dereferences stale pointers, producing the KASAN-reported corruption and a kernel oops/panic. The trigger is deterministic and repeatable 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":["drivers/iommu/iommufd/eventq.c","drivers/iommu/iommufd/main.c"],"versions":[{"version":"07838f7fd529c8a6de44b601d4b7057e6c8d36ed","lessThan":"17195a7d754a5c6a31888702ca93f6f08f3383ad","status":"affected","versionType":"git"},{"version":"07838f7fd529c8a6de44b601d4b7057e6c8d36ed","lessThan":"e4825368285e33d6360c6c6a6a10d2d83da06e55","status":"affected","versionType":"git"},{"version":"07838f7fd529c8a6de44b601d4b7057e6c8d36ed","lessThan":"4e034bf045b12852a24d5d33f2451850818ba0c1","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/iommu/iommufd/eventq.c","drivers/iommu/iommufd/main.c"],"versions":[{"version":"6.11","status":"affected"},{"version":"0","lessThan":"6.11","status":"unaffected","versionType":"semver"},{"version":"6.12.50","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.16.10","lessThanOrEqual":"6.16.*","status":"unaffected","versionType":"semver"},{"version":"6.17","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.11","versionEndExcluding":"6.12.50"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11","versionEndExcluding":"6.16.10"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11","versionEndExcluding":"6.17"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/17195a7d754a5c6a31888702ca93f6f08f3383ad"},{"url":"https://git.kernel.org/stable/c/e4825368285e33d6360c6c6a6a10d2d83da06e55"},{"url":"https://git.kernel.org/stable/c/4e034bf045b12852a24d5d33f2451850818ba0c1"}],"title":"iommufd: Fix race during abort for file descriptors","x_generator":{"engine":"bippy-1.2.0"}}}}