Vulnerability · Published Jul 19, 2026 · Assigned by Linux
CVE-2026-63895usb: gadget: f_fs: copy only received bytes on short ep0 read
Unrated
In plain English
A 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.3% (higher than 18% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: usb: gadget: f_fs: copy only received bytes on short ep0 read ffs_ep0_read() allocates its control-OUT data buffer with kmalloc() (not kzalloc) at the Length value from the Setup packet, then copies that full len to userspace regardless of how many bytes were actually received: data = kmalloc(len, GFP_KERNEL); ... ret = __ffs_ep0_queue_wait(ffs, data, len); if ((ret > 0) && (copy_to_user(buf, data, len))) ret = -EFAULT; __ffs_ep0_queue_wait() returns req->actual, which on a short control OUT transfer is strictly less than len. The copy_to_user() call still copies len bytes, so on a short OUT the last (len - ret) bytes of the kmalloc() buffer -- uninitialised slab residue -- are delivered to the FunctionFS daemon. Short ep0 OUT completions are specified USB control-transfer behavior and are produced by in-tree UDCs: * dwc2 continues on req->actual < req->length for ep0 DATA OUT (short-not-ok is the only ep0-OUT stall path). * aspeed_udc ends ep0 OUT on rx_len < ep->ep.maxpacket. * renesas_usbf logs "ep0 short packet" and completes the request. * dwc3 stalls on short IN but not on short OUT. A short ep0 OUT is therefore not evidence of a broken UDC; it is a normal condition f_fs has to cope with. The sibling gadgetfs implementation in drivers/usb/gadget/legacy/inode.c already does this correctly via min(len, dev->req->actual) before copy_to_user(). This patch brings f_fs.c to the same safe pattern rather than trimming at a defensive layer. The bug is reached from the FunctionFS device node, which in real deployments is owned by the privileged gadget daemon (adbd, UMS, composite gadget services, etc.); it is not reachable from unprivileged userspace. Linux host stacks normally reject short-wLength control OUTs before they reach the gadget, so reproducing this required a build that bypasses that host-side check. With the bypass in place, a 1-byte payload on a 64-byte Setup produces 63 bytes of non-canary slab residue in the daemon's read buffer. Fix by copying only ret (actually received) bytes to userspace.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.176-1 | DEBIAN-CVE-2026-63895 |
| Debian:13 | linux | 6.12.94-1 | DEBIAN-CVE-2026-63895 |
| Debian:14 | linux | 7.0.12-1 | DEBIAN-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux | 5.15.0-198.208 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux | 6.8.0-146.146 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux | 7.0.0-28.28 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1117.124 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1066.69 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-aws | 7.0.0-1009.9 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-aws-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-aws-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1066.69~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1123.132 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1070.78 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-azure | 7.0.0-1010.10 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1070.78~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-7.0 | 7.0.0-1014.14~24.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1122.131 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-fde | 6.8.0-1068.75 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-azure-fde | 7.0.0-1009.9 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-fde-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-fde-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.8 | 6.8.0-1068.75~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-fde-7.0 | 7.0.0-1013.13~24.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-azure-nvidia-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1118.128 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1070.78 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-gcp | 7.0.0-1008.8 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-gcp-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-gcp-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1070.78~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-gcp-7.0 | 7.0.0-1011.11~24.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1113.119 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1065.73 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-gke | 7.0.0-1003.4 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1100.108 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1051.55 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-hwe-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-hwe-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-hwe-7.0 | 7.0.0-28.28~24.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1111.115 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1066.67 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-ibm | 7.0.0-1010.10 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1066.67~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1112.118 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1109.114 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-195.205 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-146.146.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-146.146.1~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1112.113 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1064.67 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-nvidia | 7.0.0-1016.16 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-nvidia-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1064.67~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-nvidia-7.0 | 7.0.0-1016.16~24.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-nvidia-bos | 7.0.0-2016.16 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1064.67.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1070.72 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1038.42 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1059.59 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oem-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oem-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-oem-7.0 | 7.0.0-1009.9 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1114.120 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1063.66 | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-oracle | 7.0.0-1008.8 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oracle-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oracle-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-oracle-7.0 | 7.0.0-1011.11~24.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-raspi | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-raspi | 7.0.0-1015.15 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-realtime | 7.0.0-28.28.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:26.04:LTS | linux-riscv | 7.0.0-28.28.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-riscv-6.14 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-riscv-6.17 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-146.146~22.04.1 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-riscv-7.0 | 7.0.0-28.28.1~24.04.3 | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-vmware | 6.8.0-1008.8 | UBUNTU-CVE-2026-63895 |
| Ubuntu:24.04:LTS | linux-xilinx | no fix listed | UBUNTU-CVE-2026-63895 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1080.84 | UBUNTU-CVE-2026-63895 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | ddf8abd2599491cbad959c700b90ba72a5dce8d0 – before 90ccf5fb63243fae1b4b3200f3310500500ecf2eddf8abd2599491cbad959c700b90ba72a5dce8d0 – before af32dbb2ca0b3d09271ab718d13857a457fa16f2ddf8abd2599491cbad959c700b90ba72a5dce8d0 – before e835bf9a055f71874065a40780ca5560b7df8b33ddf8abd2599491cbad959c700b90ba72a5dce8d0 – before 88874a19b2b093bfaaa1c0090fa536c44da8c08bddf8abd2599491cbad959c700b90ba72a5dce8d0 – before 607730a414773a7cbe3037a64a6c64e72689ff5eddf8abd2599491cbad959c700b90ba72a5dce8d0 – before 23c1f7deb9dd8447ecde749850676302aa1e2bd3ddf8abd2599491cbad959c700b90ba72a5dce8d0 – before 4e036c10e7f4df5d951c69cc3697bc8e209c6d02 |
| Linux | Linux | 2.6.35 |
References
- https://git.kernel.org/stable/c/90ccf5fb63243fae1b4b3200f3310500500ecf2e
- https://git.kernel.org/stable/c/af32dbb2ca0b3d09271ab718d13857a457fa16f2
- https://git.kernel.org/stable/c/e835bf9a055f71874065a40780ca5560b7df8b33
- https://git.kernel.org/stable/c/88874a19b2b093bfaaa1c0090fa536c44da8c08b
- https://git.kernel.org/stable/c/607730a414773a7cbe3037a64a6c64e72689ff5e
- https://git.kernel.org/stable/c/23c1f7deb9dd8447ecde749850676302aa1e2bd3
- https://git.kernel.org/stable/c/4e036c10e7f4df5d951c69cc3697bc8e209c6d02