# CVE-2023-53693: USB: gadget: Fix the memory leak in raw\_gadget driver

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **Published:** 2025-10-22T13:23:35.280Z
- **Modified:** 2026-10-28T19:10:00.193Z

## Who should check

- Anyone running Linux \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 68e6287ac61dc22513cd39f02b9ac1fef28513e4; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 0f7a2b567197798da7bfa2252f4485c0ca6c6266; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< de77000c1923d7942f9b4f08447c8feeae1c0f33; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 9934e5d07c0dc294169a7d52f6309f35cd6d7755; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 83e30f2bf86ef7c38fbd476ed81a88522b620628
- Anyone running Linux 5.7

## 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 and fixed versions

- Linux: \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 68e6287ac61dc22513cd39f02b9ac1fef28513e4; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 0f7a2b567197798da7bfa2252f4485c0ca6c6266; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< de77000c1923d7942f9b4f08447c8feeae1c0f33; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 9934e5d07c0dc294169a7d52f6309f35cd6d7755; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 83e30f2bf86ef7c38fbd476ed81a88522b620628 (cvelist)
- Linux: 5.7 (cvelist)

## Mitigation

- Upgrade Linux to 83e30f2bf86ef7c38fbd476ed81a88522b620628 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-53693. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53693.md
Affected: Linux >= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, < 68e6287ac61dc22513cd39f02b9ac1fef28513e4; >= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, < 0f7a2b567197798da7bfa2252f4485c0ca6c6266; >= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, < de77000c1923d7942f9b4f08447c8feeae1c0f33; >= f2c2e717642c66f7fe7e5dd…
Fixed in: Linux 68e6287ac61dc22513cd39f02b9ac1fef28513e4, Linux 0f7a2b567197798da7bfa2252f4485c0ca6c6266, Linux 9934e5d07c0dc294169a7d52f6309f35cd6d7755, Linux 83e30f2bf86ef7c38fbd476ed81a88522b620628

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-53693 being exploited?

There is no confirmed exploitation: CVE-2023-53693 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-53693?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2023-53693?

Linux \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 68e6287ac61dc22513cd39f02b9ac1fef28513e4; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 0f7a2b567197798da7bfa2252f4485c0ca6c6266; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< de77000c1923d7942f9b4f08447c8feeae1c0f33; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 9934e5d07c0dc294169a7d52f6309f35cd6d7755; \>= f2c2e717642c66f7fe7e5dd69b2e8ff5849f4d10, \< 83e30f2bf86ef7c38fbd476ed81a88522b620628; Linux 5.7.

### Is there a fix for CVE-2023-53693?

Yes. Fixed in Linux 68e6287ac61dc22513cd39f02b9ac1fef28513e4, Linux 0f7a2b567197798da7bfa2252f4485c0ca6c6266, Linux 9934e5d07c0dc294169a7d52f6309f35cd6d7755, Linux 83e30f2bf86ef7c38fbd476ed81a88522b620628. Upgrade Linux to 83e30f2bf86ef7c38fbd476ed81a88522b620628 or later.

### How do I check if I'm affected by CVE-2023-53693?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- other: <https://git.kernel.org/stable/c/68e6287ac61dc22513cd39f02b9ac1fef28513e4>
- other: <https://git.kernel.org/stable/c/0f7a2b567197798da7bfa2252f4485c0ca6c6266>
- other: <https://git.kernel.org/stable/c/de77000c1923d7942f9b4f08447c8feeae1c0f33>
- other: <https://git.kernel.org/stable/c/9934e5d07c0dc294169a7d52f6309f35cd6d7755>
- other: <https://git.kernel.org/stable/c/83e30f2bf86ef7c38fbd476ed81a88522b620628>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-53693>

HTML: <https://flawdb.com/CVE-2023-53693> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-53693>
