# CVE-2021-47231: can: mcba\_usb: fix memory leak in mcba\_usb

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.31% (percentile 16, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2024-05-21T14:19:34.413Z
- **Modified:** 2026-06-17T04:16:57.830Z

## Who should check

- Anyone running Linux \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 89df95ce32be204eef2e7d4b2f6fb552fb191a68; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< a115198caaab6d663bef75823a3c5f0802306d60; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 6f87c0e21ad20dd3d22108e33db1c552dfa352a0; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 6bd3d80d1f019cefa7011056c54b323f1d8b8e83; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< d0760a4ef85697bc756d06eae17ae27f3f055401; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 91c02557174be7f72e46ed7311e3bea1939840b0
- Anyone running Linux 4.12

## Description

In the Linux kernel, the following vulnerability has been resolved:

can: mcba\_usb: fix memory leak in mcba\_usb

Syzbot reported memory leak in SocketCAN driver for Microchip CAN BUS
Analyzer Tool. The problem was in unfreed usb\_coherent.

In mcba\_usb\_start() 20 coherent buffers are allocated and there is
nothing, that frees them:

1) In callback function the urb is resubmitted and that's all
2) In disconnect function urbs are simply killed, but URB\_FREE\_BUFFER
   is not set (see mcba\_usb\_start) and this flag cannot be used with
   coherent buffers.

Fail log:
\| \[ 1354.053291\]\[ T8413\] mcba\_usb 1-1:0.0 can0: device disconnected
\| \[ 1367.059384\]\[ T8420\] kmemleak: 20 new suspected memory leaks (see /sys/kernel/debug/kmem)

So, all allocated buffers should be freed with usb\_free\_coherent()
explicitly

NOTE:
The same pattern for allocating and freeing coherent buffers
is used in drivers/net/can/usb/kvaser\_usb/kvaser\_usb\_core.c

## Affected and fixed versions

- Linux: \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 89df95ce32be204eef2e7d4b2f6fb552fb191a68; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< a115198caaab6d663bef75823a3c5f0802306d60; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 6f87c0e21ad20dd3d22108e33db1c552dfa352a0; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 6bd3d80d1f019cefa7011056c54b323f1d8b8e83; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< d0760a4ef85697bc756d06eae17ae27f3f055401; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 91c02557174be7f72e46ed7311e3bea1939840b0 (cvelist)
- Linux: 4.12 (cvelist)

## Mitigation

- Upgrade Linux to 91c02557174be7f72e46ed7311e3bea1939840b0 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47231.md
Affected: Linux >= 51f3baad7de943780ce0c17bd7975df567dd6e14, < 89df95ce32be204eef2e7d4b2f6fb552fb191a68; >= 51f3baad7de943780ce0c17bd7975df567dd6e14, < a115198caaab6d663bef75823a3c5f0802306d60; >= 51f3baad7de943780ce0c17bd7975df567dd6e14, < 6f87c0e21ad20dd3d22108e33db1c552dfa352a0; >= 51f3baad7de943780ce0c17…
Fixed in: Linux 89df95ce32be204eef2e7d4b2f6fb552fb191a68, Linux 6f87c0e21ad20dd3d22108e33db1c552dfa352a0, Linux 6bd3d80d1f019cefa7011056c54b323f1d8b8e83, Linux 91c02557174be7f72e46ed7311e3bea1939840b0

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-2021-47231 being exploited?

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

### How serious is CVE-2021-47231?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-47231?

Linux \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 89df95ce32be204eef2e7d4b2f6fb552fb191a68; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< a115198caaab6d663bef75823a3c5f0802306d60; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 6f87c0e21ad20dd3d22108e33db1c552dfa352a0; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 6bd3d80d1f019cefa7011056c54b323f1d8b8e83; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< d0760a4ef85697bc756d06eae17ae27f3f055401; \>= 51f3baad7de943780ce0c17bd7975df567dd6e14, \< 91c02557174be7f72e46ed7311e3bea1939840b0; Linux 4.12.

### Is there a fix for CVE-2021-47231?

Yes. Fixed in Linux 89df95ce32be204eef2e7d4b2f6fb552fb191a68, Linux 6f87c0e21ad20dd3d22108e33db1c552dfa352a0, Linux 6bd3d80d1f019cefa7011056c54b323f1d8b8e83, Linux 91c02557174be7f72e46ed7311e3bea1939840b0. Upgrade Linux to 91c02557174be7f72e46ed7311e3bea1939840b0 or later.

### How do I check if I'm affected by CVE-2021-47231?

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

- patch: <https://git.kernel.org/stable/c/89df95ce32be204eef2e7d4b2f6fb552fb191a68>
- patch: <https://git.kernel.org/stable/c/a115198caaab6d663bef75823a3c5f0802306d60>
- patch: <https://git.kernel.org/stable/c/6f87c0e21ad20dd3d22108e33db1c552dfa352a0>
- patch: <https://git.kernel.org/stable/c/6bd3d80d1f019cefa7011056c54b323f1d8b8e83>
- patch: <https://git.kernel.org/stable/c/d0760a4ef85697bc756d06eae17ae27f3f055401>
- patch: <https://git.kernel.org/stable/c/91c02557174be7f72e46ed7311e3bea1939840b0>

## 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-2021-47231>

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