# CVE-2021-47231: can: mcba_usb: fix memory leak in mcba_usb

- Severity: Medium 5.5 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.31%, higher than 16% of CVEs (2026-11-30)
- Published: 2024-05-21T14:19:34.413Z
- Modified: 2026-06-17T04:16:57.830Z
- Weaknesses: CWE-401
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

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

(As written by CVE List.)

## Affected

- Linux Linux: from 51f3baad7de943780ce0c17bd7975df567dd6e14 before 89df95ce32be204eef2e7d4b2f6fb552fb191a68; from 51f3baad7de943780ce0c17bd7975df567dd6e14 before a115198caaab6d663bef75823a3c5f0802306d60; from 51f3baad7de943780ce0c17bd7975df567dd6e14 before 6f87c0e21ad20dd3d22108e33db1c552dfa352a0; from 51f3baad7de943780ce0c17bd7975df567dd6e14 before 6bd3d80d1f019cefa7011056c54b323f1d8b8e83; from 51f3baad7de943780ce0c17bd7975df567dd6e14 before d0760a4ef85697bc756d06eae17ae27f3f055401; from 51f3baad7de943780ce0c17bd7975df567dd6e14 before 91c02557174be7f72e46ed7311e3bea1939840b0; 4.12 (not affected: before 4.12; from 4.14.238 up to 4.14.*; from 4.19.196 up to 4.19.*; from 5.4.128 up to 5.4.*; from 5.10.46 up to 5.10.*; from 5.12.13 up to 5.12.*; from 5.13 up to *)
- linux linux_kernel: from 4.12 before 4.14.238; from 4.15 before 4.19.196; from 4.20 before 5.4.128; from 5.5 before 5.10.46; from 5.11 before 5.12.13; 5.13

## References

- <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> (patch)

## Sources

- CVE List: [CVE-2021-47231](https://www.cve.org/CVERecord?id=CVE-2021-47231), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2021-47231](https://nvd.nist.gov/vuln/detail/CVE-2021-47231), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-47231 · Whole record: https://cve.day/CVE-2021-47231.json · Rebuilt by cve.day 2026-11-25T22:58:08.747Z
