# CVE-2021-47586: net: stmmac: dwmac-rk: fix oob read in rk_gmac_setup

- 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.27%, higher than 12% of CVEs (2026-11-30)
- Published: 2024-06-19T14:53:51.445Z
- Modified: 2026-06-17T04:17:49.120Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

net: stmmac: dwmac-rk: fix oob read in rk_gmac_setup

KASAN reports an out-of-bounds read in rk_gmac_setup on the line:

	while (ops->regs[i]) {

This happens for most platforms since the regs flexible array member is
empty, so the memory after the ops structure is being read here.  It
seems that mostly this happens to contain zero anyway, so we get lucky
and everything still works.

To avoid adding redundant data to nearly all the ops structures, add a
new flag to indicate whether the regs field is valid and avoid this loop
when it is not.

(As written by CVE List.)

## Affected

- Linux Linux: from 3bb3d6b1c1957e88bfc5e77a4557f7e6ba761fe3 before 0b4a5d1e15ce72f69be48f38dc0401dab890ae0f; from 3bb3d6b1c1957e88bfc5e77a4557f7e6ba761fe3 before 0546b224cc7717cc8a2db076b0bb069a9c430794; 5.14 (not affected: before 5.14; from 5.15.11 up to 5.15.*; from 5.16 up to *)
- linux linux_kernel: from 5.14 before 5.15.11; 5.16

## References

- <https://git.kernel.org/stable/c/0b4a5d1e15ce72f69be48f38dc0401dab890ae0f> (patch)
- <https://git.kernel.org/stable/c/0546b224cc7717cc8a2db076b0bb069a9c430794> (patch)

## Sources

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

---

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