AZL-115007: CVE-2026-99511 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
media: cx23885: Fix use-after-free in cx23885finidev due to race condition
In cx23885v4l2devnotifyinit, &dev->cx25840work is bound with cx23885avworkhandler, and &dev->irrxwork and &dev->irtxwork are bound with cx23885irrxworkhandler and cx23885irtxworkhandler. cx23885irq can schedule these works on systemwq when an AVCORE interrupt is received, and the IR subdevice can also schedule the IR works from its interrupt service routine via the v4l2device notify callback.
If we remove the device, cx23885finidev makes cleanup and the memory allocated for dev is released by kfree(dev), while the works mentioned above may still be pending or running. The sequence of operations that may lead to a UAF bug is as follows:
CPU0 CPU1
| cx23885irq | schedulework(&dev->cx25840work) cx23885finidev | cx23885inputfini(dev) | cx23885irfini(dev) | cx23885shutdown(dev) | freeirq(pcidev->irq, dev) | pcidisabledevice(pcidev) | cx23885devunregister(dev) | v4l2deviceunregister(v4l2dev) | kfree(dev) | // dev is freed | | cx23885avworkhandler | // use dev (use-after-free)
Fix it by canceling the works after the IRQ handler that can schedule them has been stopped, and before proceeding with the remaining cleanup in cx23885finidev.
Note that the flushwork() calls in cx23885inputirstop() do not close this race: they only wait for works that are already queued or running at that moment, they do not prevent the IRQ handler, which is still registered at that point, from scheduling the works again afterwards, and they are skipped entirely when dev->sdir is NULL. The cancelworksync() calls are therefore placed after freeirq(), the only point at which no new work can be scheduled.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In cx23885_finidev, call cancel_work_sync() for the cx23885 work items after free_irq() so the IRQ handler can no longer schedule them before dev is freed; skip these calls when dev->sd_ir is NULL.