AZL-117872: CVE-2026-142984 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: userial: pin ports while TTYs are installed
A slab-use-after-free can occur when gserialfreeline() frees struct gsport while it is still reachable through an installed TTY. The port->port.count value tracks successful opens, but it is zero before gsopen() and again after gsclose(), before TTY cleanup has finished. Teardown can therefore free gsport while ttyinitdev() or releasetty() still accesses its ttyport.
Manage gsport lifetime with ttyport references. Take a reference in gsinstall(), drop it in gscleanup(), and move the final free to gsportdestruct(). Unregister the TTY device before dropping the owner reference.
Keep each minor reserved until the old port is destroyed so an installed TTY for one generation cannot overlap a replacement at the same minor. Publish the new port before device registration so the cdev and add uevent never expose a TTY before gsinstall() can pin it. Since commit 8df07fe93573 ("tty: fix saved termios reset race"), userial registration no longer frees saved termios. On registration failure, unpublish the port before dropping its owner reference.
Check in gsopen() that the installed port is still the published generation. Track failures after a successful install so close callbacks issued by the TTY core do not decrement port->port.count for opens that never incremented it.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Patch 8df07fe93573
Event History
Frequently Asked Questions
Which systems are most likely to encounter this issue?
Systems using the Linux USB gadget u_serial driver and installing TTYs are exposed to the relevant teardown path. The risk arises when a gserial port is freed while its installed TTY still retains access to the associated tty_port.
What condition triggers the use-after-free?
The vulnerable window occurs during port teardown when port->port.count is zero before gs_open() or after gs_close(), even though TTY initialization or cleanup may still be accessing the port. This can allow gserial_free_line() to free gs_port prematurely.
How can I identify potentially affected installations?
Check whether the system is running the Azure Linux kernel package version 6.6.161.1-1. Also determine whether the USB gadget u_serial functionality and installed TTYs are used, since the issue is in that driver’s TTY and port-lifetime handling.