AZL-114893: CVE-2026-99449 affecting package kernel 6.6.161.1-1
In the Linux kernel, the following vulnerability has been resolved:
usb: gadget: fix refcount underflow in gadgetfsbind() error path
gadgetfsbind() calls getdev() only on the success path, but gadgetfsunbind() called from the enomem error label unconditionally calls putdev(). When bind fails (e.g. ENOMEM), putdev() fires without a matching getdev(), leaving the refcount unbalanced.
A subsequent close of the ep0 file descriptor calls devrelease() -> putdev() which hits zero and frees the object; then gadgetfskillsb() calls putdev(thedevice) again on the already-freed pointer, triggering a refcount underflow and use-after-free.
Fix by calling getdev() at the start of gadgetfsbind(), before any error path that invokes gadgetfsunbind(), so the reference is always balanced regardless of whether bind succeeds or fails.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In gadgetfs_bind(), call get_dev() at the start, before any error path that calls put_dev(), so the reference is balanced whether bind succeeds or fails.