Vulnerability · Published May 1, 2024 · Assigned by Linux

CVE-2024-26996usb: gadget: f_ncm: Fix UAF ncm object at re-bind after usb ep transport error

High 7.8

In plain English

A high-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.2% (higher than 15% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.8High
Exploit odds (30 days)0.2%top 85.5% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_ncm: Fix UAF ncm object at re-bind after usb ep transport error When ncm function is working and then stop usb0 interface for link down, eth_stop() is called. At this piont, accidentally if usb transport error should happen in usb_ep_enable(), 'in_ep' and/or 'out_ep' may not be enabled. After that, ncm_disable() is called to disable for ncm unbind but gether_disconnect() is never called since 'in_ep' is not enabled. As the result, ncm object is released in ncm unbind but 'dev->port_usb' associated to 'ncm->port' is not NULL. And when ncm bind again to recover netdev, ncm object is reallocated but usb0 interface is already associated to previous released ncm object. Therefore, once usb0 interface is up and eth_start_xmit() is called, released ncm object is dereferrenced and it might cause use-after-free memory. [function unlink via configfs] usb0: eth_stop dev->port_usb=ffffff9b179c3200 --> error happens in usb_ep_enable(). NCM: ncm_disable: ncm=ffffff9b179c3200 --> no gether_disconnect() since ncm->port.in_ep->enabled is false. NCM: ncm_unbind: ncm unbind ncm=ffffff9b179c3200 NCM: ncm_free: ncm free ncm=ffffff9b179c3200 <-- released ncm [function link via configfs] NCM: ncm_alloc: ncm alloc ncm=ffffff9ac4f8a000 NCM: ncm_bind: ncm bind ncm=ffffff9ac4f8a000 NCM: ncm_set_alt: ncm=ffffff9ac4f8a000 alt=0 usb0: eth_open dev->port_usb=ffffff9b179c3200 <-- previous released ncm usb0: eth_start dev->port_usb=ffffff9b179c3200 <-- eth_start_xmit() --> dev->wrap() Unable to handle kernel paging request at virtual address dead00000000014f This patch addresses the issue by checking if 'ncm->netdev' is not NULL at ncm_disable() to call gether_disconnect() to deassociate 'dev->port_usb'. It's more reasonable to check 'ncm->netdev' to call gether_connect/disconnect rather than check 'ncm->port.in_ep->enabled' since it might not be enabled but the gether connection might be established.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux6.1.90-1DSA-5680-1
Debian:12linux6.1.90-1DEBIAN-CVE-2024-26996
Debian:13linux6.8.9-1DEBIAN-CVE-2024-26996
Debian:14linux6.8.9-1DEBIAN-CVE-2024-26996
Ubuntu:22.04:LTSlinux5.15.0-116.126UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux6.8.0-38.38UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux6.8.0-38.38USN-6893-1
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-aws5.15.0-1065.71UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-aws6.8.0-1011.12UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-aws6.8.0-1011.12USN-6893-3
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-aws-6.86.8.0-1011.12~22.04.1UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-azure5.15.0-1068.77UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-azure6.8.0-1010.10UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-azure6.8.0-1010.10USN-6893-1
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-azure-6.86.8.0-1010.10~22.04.1UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-azure-fde5.15.0-1068.77.1UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-gcp5.15.0-1064.72UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-gcp6.8.0-1010.11UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-gcp6.8.0-1010.11USN-6893-1
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-gke5.15.0-1062.68UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-gke6.8.0-1006.9UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-gke6.8.0-1006.9USN-6893-2
Ubuntu:22.04:LTSlinux-gkeop5.15.0-1048.55UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-ibm5.15.0-1058.61UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-ibm6.8.0-1008.8UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-ibm6.8.0-1008.8USN-6893-1
Ubuntu:24.04:LTSlinux-intel6.8.0-1007.14UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-intel6.8.0-1007.14USN-6893-1
Ubuntu:22.04:LTSlinux-intel-iotg5.15.0-1060.66UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-kvm5.15.0-1062.67UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-lowlatency5.15.0-116.126UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-38.38.1USN-6893-1
Ubuntu:24.04:LTSlinux-lowlatency6.8.0-38.38.1UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-nvidia5.15.0-1060.61UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1009.9UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-nvidia6.8.0-1009.9USN-6893-2
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-nvidia-6.86.8.0-1009.9~22.04.1UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-nvidia-tegra5.15.0-1026.26UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-nvidia-tegra-igx5.15.0-1015.15UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1008.8USN-6893-1
Ubuntu:24.04:LTSlinux-oem-6.86.8.0-1008.8UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-oracle5.15.0-1063.69UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-oracle6.8.0-1008.8UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-oracle6.8.0-1008.8USN-6918-1
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-oracle-6.86.8.0-1008.8~22.04.1UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-raspi5.15.0-1058.61UBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-raspi6.8.0-1007.7USN-6893-1
Ubuntu:24.04:LTSlinux-raspi6.8.0-1007.7UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2024-26996
Ubuntu:24.04:LTSlinux-riscv6.8.0-38.38.1UBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2024-26996
Ubuntu:22.04:LTSlinux-xilinx-zynqmp5.15.0-1035.39UBUNTU-CVE-2024-26996

Affected products (as reported)

VendorProductVersions
Linux Linux 6b4012a2e4d4702f8fb0ee1db1c0f0b17ab7d41b – before 7f67c2020cb08499c400abf0fc32c65e4d9a09ca6b4012a2e4d4702f8fb0ee1db1c0f0b17ab7d41b – before 0588bbbd718a8130b98c54518f1e0b569ce60a936b4012a2e4d4702f8fb0ee1db1c0f0b17ab7d41b – before f356fd0cbd9c9cbd0854657a80d1608d0d732db36b4012a2e4d4702f8fb0ee1db1c0f0b17ab7d41b – before 7250326cbb1f4f90391ac511a126b936cefb5bb76b4012a2e4d4702f8fb0ee1db1c0f0b17ab7d41b – before 6334b8e4553cc69f51e383c9de545082213d785e
Linux Linux 4.4

References