{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143091","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-12-03T03:10:28.347Z","datePublished":"2026-12-03T09:19:13.418Z","dateUpdated":"2026-12-04T03:29:04.857Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-12-04T03:29:04.857Z"},"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nxen/privcmd: fix double free when an irqfd is shut down twice\n\nirqfd_deactivate() takes the irqfd off irqfds_list and queues\nirqfd_shutdown().  queue_work() is not a once-only gate: it refuses to\nenqueue a work item only while WORK_STRUCT_PENDING is set, and\nprocess_one_work() clears that bit before it calls the work function.  So\nnothing records that the shutdown work has already been queued, and\nnothing protects the window between the start of irqfd_shutdown() and the\nkfree() at its end.\n\nTwo paths call irqfd_deactivate() for the same irqfd:\n\n  - privcmd_irqfd_deassign(), from the PRIVCMD_IRQFD_FLAG_DEASSIGN ioctl;\n\n  - irqfd_wakeup(), with EPOLLHUP set, when the last reference to the\n    eventfd file goes away, which runs wake_up_poll(&ctx->wqh, EPOLLHUP)\n    from eventfd_release().\n\nirqfds_lock serialises the two calls, but it does not make the second one\na no-op, and eventfd_ctx_fdget() takes a reference to the eventfd_ctx,\nnot to the struct file, so the last fd can still be closed while the\nioctl is running:\n\n  CPU0                                 CPU1\n\n  eventfd_ctx_fdget()\n  spin_lock(irqfds_lock)\n  list_del_init(&kirqfd->list)\n  queue_work(&kirqfd->shutdown)        close(fd)\n                                         eventfd_release()\n                                           wake_up_poll(EPOLLHUP)\n                                         irqfd_wakeup()\n                                         spin_lock(irqfds_lock)\n                                         irqfd_deactivate() again\n\nIf the work item has already started by then, its pending bit has been\ncleared and the second queue_work() succeeds.  irqfd_shutdown() then runs\ntwice, so eventfd_ctx_remove_wait_queue(), eventfd_ctx_put() and kfree()\neach hit the same object a second time; and when the second queue_work()\nlands after the irqfd has been freed, the workqueue list operations write\nto freed memory.\n\nvirt/kvm/eventfd.c has the same two callers and has had this guard since\nthe original irqfd support (721eecbf4fe99): irqfd_wakeup() calls\nirqfd_deactivate() only if irqfd_is_active().  The comment there explains\nwhy that is enough: the other side deactivates the irqfd before it takes\nit off the waitqueue, and irqfd_shutdown() needs the waitqueue lock,\nwhich this callback holds, so the irqfd cannot be freed under it.\n\nDo the same here.  list_del_init() leaves the list head empty and the\nirqfd stays off the list until kfree(), so it serves as a one-way\n\"active\" flag.  The test is in irqfd_deactivate() rather than in\nirqfd_wakeup() because privcmd_irqfd_deassign() walks irqfds_list and can\ntherefore never reach an inactive irqfd; only the wakeup path can, and a\nsingle test covers both callers."}],"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 - IOCTL_PRIVCMD_IRQFD in privcmd_ioctl() reaches irqfd_deactivate() through privcmd_irqfd_deassign(), and close() of that same eventfd reaches it again through eventfd_release(), wake_up_poll(EPOLLHUP), and irqfd_wakeup(). Those two local calls are what queue irqfd_shutdown() twice.\nAC:L - The caller holds both the privcmd fd and the eventfd, so it races PRIVCMD_IRQFD_FLAG_DEASSIGN with close(). process_one_work() clears WORK_STRUCT_PENDING before irqfd_shutdown(), which then blocks in synchronize_srcu() before kfree(), and the caller can repeat that race.\nPR:L - privcmd_ioctl_irqfd() never calls capable(). After IOCTL_PRIVCMD_RESTRICT stores data->domid, the only check is irqfd.dom == data->domid, so the restricted device-model fd still reaches privcmd_irqfd_deassign() without root or a user namespace.\nUI:N - The same process assigns the irqfd with IOCTL_PRIVCMD_IRQFD and then races PRIVCMD_IRQFD_FLAG_DEASSIGN against close() of its own eventfd.\nS:U - The double kfree() in irqfd_shutdown() corrupts slab memory of the kernel that executed the ioctl. IOCTL_PRIVCMD_IRQFD is a local privcmd ioctl in that domain and does not enter the Xen hypervisor.\nC:H - The second irqfd_shutdown() loads kirqfd->eventfd after kfree() and eventfd_ctx_remove_wait_queue() reads that eventfd_ctx, including ctx->count in eventfd_ctx_do_read(). The extra eventfd_ctx_put() frees the ctx, so a reclaimed object is read back as kernel pointers.\nI:H - queue_work() links the freed kirqfd->shutdown into the workqueue, the second kfree() frees that object again, and __remove_wait_queue() list_del()s kirqfd->wait after the first list_del() poisoned it. privcmd_irqfd_assign() sizes the slab with caller-chosen irqfd->size.\nA:H - The second kfree(kirqfd), the extra eventfd_ctx_put() on the eventfd_ctx, and list_del() of the already-unlinked kirqfd->wait.entry in eventfd_ctx_remove_wait_queue() fault or oops the kernel."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/xen/privcmd.c"],"versions":[{"version":"f8941e6c4c712948663ec5d7bbb546f1a0f4e3f6","lessThan":"c8dbf2b184aa82558fdcc1d58d4d2834b7743323","status":"affected","versionType":"git"},{"version":"f8941e6c4c712948663ec5d7bbb546f1a0f4e3f6","lessThan":"de87d311d5a3a5752949acb41962a86f31ce2ef0","status":"affected","versionType":"git"},{"version":"f8941e6c4c712948663ec5d7bbb546f1a0f4e3f6","lessThan":"bec55c715b27e1eec4471968802c9d10ff6fef4e","status":"affected","versionType":"git"},{"version":"f8941e6c4c712948663ec5d7bbb546f1a0f4e3f6","lessThan":"72a900c666adb97df77b05cf8540c4117f9c83ba","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/xen/privcmd.c"],"versions":[{"version":"6.6","status":"affected"},{"version":"0","lessThan":"6.6","status":"unaffected","versionType":"semver"},{"version":"6.12.120","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.18.66","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"7.3.7","lessThanOrEqual":"7.3.*","status":"unaffected","versionType":"semver"},{"version":"7.4-rc3","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.6","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6","versionEndExcluding":"7.4-rc3"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/c8dbf2b184aa82558fdcc1d58d4d2834b7743323"},{"url":"https://git.kernel.org/stable/c/de87d311d5a3a5752949acb41962a86f31ce2ef0"},{"url":"https://git.kernel.org/stable/c/bec55c715b27e1eec4471968802c9d10ff6fef4e"},{"url":"https://git.kernel.org/stable/c/72a900c666adb97df77b05cf8540c4117f9c83ba"}],"title":"xen/privcmd: fix double free when an irqfd is shut down twice","x_generator":{"engine":"bippy-1.2.0"}}}}