PT-2026-166946
CVE-2026-143091
·
Publicado
2026-12-03
·
Atualizado
2026-12-03
Descrição por
Pontuação
N/A
Não disponívelNão há classificações de severidade ou métricas disponíveis. Quando houver, atualizaremos as informações correspondentes na página.
In the Linux kernel, the following vulnerability has been resolved:
xen/privcmd: fix double free when an irqfd is shut down twice
irqfd deactivate() takes the irqfd off irqfds list and queues
irqfd shutdown(). queue work() is not a once-only gate: it refuses to
enqueue a work item only while WORK STRUCT PENDING is set, and
process one work() clears that bit before it calls the work function. So
nothing records that the shutdown work has already been queued, and
nothing protects the window between the start of irqfd shutdown() and the
kfree() at its end.
Two paths call irqfd deactivate() for the same irqfd:
-
privcmd irqfd deassign(), from the PRIVCMD IRQFD FLAG DEASSIGN ioctl;
-
irqfd wakeup(), with EPOLLHUP set, when the last reference to the eventfd file goes away, which runs wake up poll(&ctx->wqh, EPOLLHUP) from eventfd release().
irqfds lock serialises the two calls, but it does not make the second one
a no-op, and eventfd ctx fdget() takes a reference to the eventfd ctx,
not to the struct file, so the last fd can still be closed while the
ioctl is running:
CPU0 CPU1
eventfd ctx fdget()
spin lock(irqfds lock)
list del init(&kirqfd->list)
queue work(&kirqfd->shutdown) close(fd)
eventfd release()
wake up poll(EPOLLHUP)
irqfd wakeup()
spin lock(irqfds lock)
irqfd deactivate() again
If the work item has already started by then, its pending bit has been
cleared and the second queue work() succeeds. irqfd shutdown() then runs
twice, so eventfd ctx remove wait queue(), eventfd ctx put() and kfree()
each hit the same object a second time; and when the second queue work()
lands after the irqfd has been freed, the workqueue list operations write
to freed memory.
virt/kvm/eventfd.c has the same two callers and has had this guard since
the original irqfd support (721eecbf4fe99): irqfd wakeup() calls
irqfd deactivate() only if irqfd is active(). The comment there explains
why that is enough: the other side deactivates the irqfd before it takes
it off the waitqueue, and irqfd shutdown() needs the waitqueue lock,
which this callback holds, so the irqfd cannot be freed under it.
Do the same here. list del init() leaves the list head empty and the
irqfd stays off the list until kfree(), so it serves as a one-way
"active" flag. The test is in irqfd deactivate() rather than in
irqfd wakeup() because privcmd irqfd deassign() walks irqfds list and can
therefore never reach an inactive irqfd; only the wakeup path can, and a
single test covers both callers.
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾