Description
In the Linux kernel, the following vulnerability has been resolved:
USB: gadget: Fix the memory leak in raw_gadget driver
Currently, increasing raw_dev->count happens before invoke the
raw_queue_event(), if the raw_queue_event() return error, invoke
raw_release() will not trigger the dev_free() to be called.
[ 268.905865][ T5067] raw-gadget.0 gadget.0: failed to queue event
[ 268.912053][ T5067] udc dummy_udc.0: failed to start USB Raw Gadget: -12
[ 268.918885][ T5067] raw-gadget.0: probe of gadget.0 failed with error -12
[ 268.925956][ T5067] UDC core: USB Raw Gadget: couldn't find an available UDC or it's busy
[ 268.934657][ T5067] misc raw-gadget: fail, usb_gadget_register_driver returned -16
BUG: memory leak
[<ffffffff8154bf94>] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076
[<ffffffff8347eb55>] kmalloc include/linux/slab.h:582 [inline]
[<ffffffff8347eb55>] kzalloc include/linux/slab.h:703 [inline]
[<ffffffff8347eb55>] dev_new drivers/usb/gadget/legacy/raw_gadget.c:191 [inline]
[<ffffffff8347eb55>] raw_open+0x45/0x110 drivers/usb/gadget/legacy/raw_gadget.c:385
[<ffffffff827d1d09>] misc_open+0x1a9/0x1f0 drivers/char/misc.c:165
[<ffffffff8154bf94>] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076
[<ffffffff8347cd2f>] kmalloc include/linux/slab.h:582 [inline]
[<ffffffff8347cd2f>] raw_ioctl_init+0xdf/0x410 drivers/usb/gadget/legacy/raw_gadget.c:460
[<ffffffff8347dfe9>] raw_ioctl+0x5f9/0x1120 drivers/usb/gadget/legacy/raw_gadget.c:1250
[<ffffffff81685173>] vfs_ioctl fs/ioctl.c:51 [inline]
[<ffffffff8154bf94>] kmalloc_trace+0x24/0x90 mm/slab_common.c:1076
[<ffffffff833ecc6a>] kmalloc include/linux/slab.h:582 [inline]
[<ffffffff833ecc6a>] kzalloc include/linux/slab.h:703 [inline]
[<ffffffff833ecc6a>] dummy_alloc_request+0x5a/0xe0 drivers/usb/gadget/udc/dummy_hcd.c:665
[<ffffffff833e9132>] usb_ep_alloc_request+0x22/0xd0 drivers/usb/gadget/udc/core.c:196
[<ffffffff8347f13d>] gadget_bind+0x6d/0x370 drivers/usb/gadget/legacy/raw_gadget.c:292
This commit therefore invoke kref_get() under the condition that
raw_queue_event() return success.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Linux | Linux | 5.7 | 5.10.190 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | linux | 6.4.11-1 | — |
| Debian 13 | linux | 6.4.11-1 | — |
| Debian 12 | linux | 6.1.52-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Nvidia-BlueField 22.04 LTS | linux-bluefield | 5.15.0-1031.33 | — |
| Ubuntu 24.04 LTS | linux-riscv +8 | No fix yet | — |
| Ubuntu 22.04 LTS | linux +1 | 5.15.0-88.98 | — |
| Ubuntu 22.04 LTS | linux-aws | 5.15.0-1049.54 | — |
| Ubuntu 22.04 LTS | linux-azure | 5.15.0-1051.59 | — |
| Ubuntu 22.04 LTS | linux-azure-fde | 5.15.0-1051.59.1 | — |
| Ubuntu 22.04 LTS | linux-gcp | 5.15.0-1046.54 | — |
| Ubuntu 22.04 LTS | linux-gke +1 | 5.15.0-1046.51 | — |
| Ubuntu 22.04 LTS | linux-gkeop | 5.15.0-1032.38 | — |
| Ubuntu 22.04 LTS | linux-ibm +1 | 5.15.0-1042.45 | — |
| Ubuntu 22.04 LTS | linux-intel-iotg | 5.15.0-1045.51 | — |
| Ubuntu 22.04 LTS | linux-nvidia | 5.15.0-1040.40 | — |
| Ubuntu 22.04 LTS | linux-nvidia-tegra | 5.15.0-1019.19 | — |
| Ubuntu 22.04 LTS | linux-nvidia-tegra-igx | 5.15.0-1006.6 | — |
| Ubuntu 22.04 LTS | linux-oracle | 5.15.0-1047.53 | — |
| Ubuntu 22.04 LTS | linux-riscv +32 | No fix yet | — |
| Ubuntu 22.04 LTS | linux-xilinx-zynqmp | 5.15.0-1025.29 | — |
| Ubuntu 20.04 LTS | linux-aws-5.15 | 5.15.0-1049.54~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-azure-5.15 | 5.15.0-1051.59~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-gcp-5.15 | 5.15.0-1046.54~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-gke +28 | No fix yet | — |
| Ubuntu 20.04 LTS | linux-hwe-5.15 +1 | 5.15.0-88.98~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-ibm-5.15 | 5.15.0-1042.45~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-intel-iotg-5.15 | 5.15.0-1045.51~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-nvidia-tegra-5.15 | 5.15.0-1019.19~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-oracle-5.15 | 5.15.0-1047.53~20.04.1 | — |
| Ubuntu 20.04 LTS | linux-riscv-5.15 | 5.15.0-1045.49~20.04.1 | — |
| Ubuntu 18.04 LTS | linux-gcp +14 | No fix yet | — |
Show 3 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | linux-hwe-edge | No fix yet | — |
| Ubuntu Pro Realtime 22.04 LTS | linux-intel-iot-realtime | 5.15.0-1042.44 | — |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime | 5.15.0-1050.56 | — |
| Ubuntu Pro FIPS-preview 22.04 LTS | linux-fips | No fix yet | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES 15 SP7 | kernel-64kb +6 | 6.4.0-150700.53.22.1 | SUSE-SU-2025:4057-1 |
| SLES 15 SP7 | kernel-azure +2 | 6.4.0-150700.20.18.1 | SUSE-SU-2025:4132-1 |
| SLES 15 SP7 | kernel-default-base | 6.4.0-150700.53.22.1.150700.17.15.1 | SUSE-SU-2025:4057-1 |
| SLES 15 SP6 | kernel-64kb +6 | 6.4.0-150600.23.78.1 | SUSE-SU-2025:4140-1 |
| SLES 15 SP6 | kernel-azure +2 | 6.4.0-150600.8.55.1 | SUSE-SU-2025:4128-1 |
| SLES 15 SP6 | kernel-default-base | 6.4.0-150600.23.78.1.150600.12.34.2 | SUSE-SU-2025:4140-1 |
| SLES 15 SP5 | kernel-64kb +6 | 5.14.21-150500.55.127.1 | SUSE-SU-2025:4320-1 |
| SLES 15 SP5 | kernel-default-base | 5.14.21-150500.55.127.1.150500.6.61.1 | SUSE-SU-2025:4320-1 |
| SLES 15 SP4 | kernel-64kb +6 | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
| SLES 15 SP4 | kernel-default-base | 5.14.21-150400.24.184.1.150400.24.94.2 | SUSE-SU-2025:4111-1 |
Show 17 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 15 SP5 | kernel-default-base | 5.14.21-150500.55.127.1.150500.6.61.1 | SUSE-SU-2025:4320-1 |
| SLES for SAP 15 SP5 | kernel-docs +4 | 5.14.21-150500.55.127.1 | SUSE-SU-2025:4320-1 |
| SLES for SAP 15 SP4 | kernel-default-base | 5.14.21-150400.24.184.1.150400.24.94.2 | SUSE-SU-2025:4111-1 |
| SLES for SAP 15 SP4 | kernel-docs +4 | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
| SLE Micro 6.1 | kernel-default-base | 6.4.0-36.1.21.13 | SUSE-SU-2025:21056-1 |
| SLE Micro 6.1 | kernel-rt +1 | 6.4.0-38.1 | SUSE-SU-2025:21064-1 |
| SLE Micro 6.1 | kernel-source +2 | 6.4.0-36.1 | SUSE-SU-2025:21056-1 |
| SLE Micro 6.0 | kernel-default-base | 6.4.0-36.1.21.13 | SUSE-SU-2025:21040-1 |
| SLE Micro 6.0 | kernel-rt +1 | 6.4.0-38.1 | SUSE-SU-2025:21052-1 |
| SLE Micro 6.0 | kernel-source +2 | 6.4.0-36.1 | SUSE-SU-2025:21040-1 |
| SLE Micro 5.5 | kernel-default-base | 5.14.21-150500.55.127.1.150500.6.61.1 | SUSE-SU-2025:4320-1 |
| SLE Micro 5.5 | kernel-rt +1 | 5.14.21-150500.13.112.1 | SUSE-SU-2025:4149-1 |
| SLE Micro 5.5 | kernel-source +1 | 5.14.21-150500.55.127.1 | SUSE-SU-2025:4320-1 |
| SLE Micro 5.4 | kernel-default | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
| SLE Micro 5.4 | kernel-default-base | 5.14.21-150400.24.184.1.150400.24.94.2 | SUSE-SU-2025:4111-1 |
| SLE Micro 5.4 | kernel-rt +1 | 5.14.21-150400.15.136.1 | SUSE-SU-2025:4139-1 |
| SLE Micro 5.3 | kernel-default | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
| SLE Micro 5.3 | kernel-default-base | 5.14.21-150400.24.184.1.150400.24.94.2 | SUSE-SU-2025:4111-1 |
| SLE Micro 5.3 | kernel-rt +1 | 5.14.21-150400.15.136.1 | SUSE-SU-2025:4139-1 |
| SLE Live Patching 15 SP7 | kernel-default | 6.4.0-150700.53.22.1 | SUSE-SU-2025:4057-1 |
| SLE Live Patching 15 SP7 | kernel-livepatch-SLE15-SP7-RT_Update_6 | 1-150700.1.3.1 | SUSE-SU-2025:4141-1 |
| SLE Live Patching 15 SP7 | kernel-livepatch-SLE15-SP7_Update_6 | 1-150700.15.3.1 | SUSE-SU-2025:4057-1 |
| SLE Live Patching 15 SP6 | kernel-default | 6.4.0-150600.23.78.1 | SUSE-SU-2025:4140-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6-RT_Update_17 | 1-150600.1.3.1 | SUSE-SU-2025:4301-1 |
| SLE Live Patching 15 SP6 | kernel-livepatch-SLE15-SP6_Update_17 | 1-150600.13.5.1 | SUSE-SU-2025:4140-1 |
| SLE Live Patching 15 SP5 | kernel-default | 5.14.21-150500.55.127.1 | SUSE-SU-2025:4320-1 |
| SLE Live Patching 15 SP5 | kernel-livepatch-SLE15-SP5_Update_32 | 1-150500.11.3.1 | SUSE-SU-2025:4320-1 |
| SLE Live Patching 15 SP4 | kernel-default | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
| SLE Live Patching 15 SP4 | kernel-livepatch-SLE15-SP4_Update_46 | 1-150400.9.5.1 | SUSE-SU-2025:4111-1 |
| SLE HPC 15 SP5 | kernel-64kb +5 | 5.14.21-150500.55.127.1 | SUSE-SU-2025:4320-1 |
| SLE HPC 15 SP5 | kernel-default-base | 5.14.21-150500.55.127.1.150500.6.61.1 | SUSE-SU-2025:4320-1 |
| SLE HPC 15 SP4 | kernel-64kb +5 | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
| SLE HPC 15 SP4 | kernel-default-base | 5.14.21-150400.24.184.1.150400.24.94.2 | SUSE-SU-2025:4111-1 |
| SUSE Real Time Module 15 SP7 | kernel-rt +2 | 6.4.0-150700.7.22.1 | SUSE-SU-2025:4141-1 |
| SUSE Real Time Module 15 SP6 | kernel-rt +3 | 6.4.0-150600.10.58.1 | SUSE-SU-2025:4301-1 |
| SUSE Manager Server LTS 4.3 | kernel-default-base | 5.14.21-150400.24.184.1.150400.24.94.2 | SUSE-SU-2025:4111-1 |
| SUSE Manager Server LTS 4.3 | kernel-syms +3 | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
| SUSE Manager Proxy LTS 4.3 | kernel-default-base | 5.14.21-150400.24.184.1.150400.24.94.2 | SUSE-SU-2025:4111-1 |
| SUSE Manager Proxy LTS 4.3 | kernel-syms +2 | 5.14.21-150400.24.184.1 | SUSE-SU-2025:4111-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 15.6 | dtb-aarch64 +10 | 6.4.0-150600.23.78.1 | SUSE-SU-2025:4140-1 |
| openSUSE Leap 15.6 | kernel-azure +2 | 6.4.0-150600.8.55.1 | SUSE-SU-2025:4128-1 |
| openSUSE Leap 15.6 | kernel-default-base | 6.4.0-150600.23.78.1.150600.12.34.2 | SUSE-SU-2025:4140-1 |
| openSUSE Leap 15.6 | kernel-rt +3 | 6.4.0-150600.10.58.1 | SUSE-SU-2025:4301-1 |
Advisories 15
- WID-SEC-2025-2394 Linux Kernel: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 9, 2026
- SUSE-SU-2025:4139-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:4140-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:4149-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:21056-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:4141-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:4111-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:21040-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:21052-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:21064-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2025:4128-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:4320-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:4132-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:4057-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
- SUSE-SU-2025:4301-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Feb 4, 2026
References
- https://git.kernel.org/stable/c/68e6287ac61dc22513cd39f02b9ac1fef28513e4
- https://git.kernel.org/stable/c/0f7a2b567197798da7bfa2252f4485c0ca6c6266
- https://git.kernel.org/stable/c/de77000c1923d7942f9b4f08447c8feeae1c0f33
- https://git.kernel.org/stable/c/9934e5d07c0dc294169a7d52f6309f35cd6d7755
- https://git.kernel.org/stable/c/83e30f2bf86ef7c38fbd476ed81a88522b620628