# CVE-2021-47159: net: dsa: fix a crash if ->get_sset_count() fails

- Severity: High 7.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/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.25%, higher than 17% of CVEs (2026-12-01)
- Published: 2024-03-25T09:16:13.815Z
- Modified: 2026-08-05T08:46:23.974Z
- Weaknesses: CWE-835
- 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: dsa: fix a crash if ->get_sset_count() fails

If ds->ops->get_sset_count() fails then it "count" is a negative error
code such as -EOPNOTSUPP.  Because "i" is an unsigned int, the negative
error code is type promoted to a very high value and the loop will
corrupt memory until the system crashes.

Fix this by checking for error codes and changing the type of "i" to
just int.

(As written by CVE List.)

## Affected

- Linux Linux: from badf3ada60ab8f76f9488dc8f5c0c57f70682f5a before 0f2cb08c57edefb0e7b5045e0e3e9980a3d3aa37; from badf3ada60ab8f76f9488dc8f5c0c57f70682f5a before ce5355f140a7987011388c7e30c4f8fbe180d3e8; from badf3ada60ab8f76f9488dc8f5c0c57f70682f5a before caff86f85512b8e0d9830e8b8b0dfe13c68ce5b6; from badf3ada60ab8f76f9488dc8f5c0c57f70682f5a before 7b22466648a4f8e3e94f57ca428d1531866d1373; from badf3ada60ab8f76f9488dc8f5c0c57f70682f5a before a269333fa5c0c8e53c92b5a28a6076a28cde3e83; 4.7 (not affected: before 4.7; from 4.19.193 up to 4.19.*; from 5.4.124 up to 5.4.*; from 5.10.42 up to 5.10.*; from 5.12.9 up to 5.12.*; from 5.13 up to *)
- linux linux_kernel: from 4.7 before 4.19.193; from 4.20 before 5.4.124; from 5.5 before 5.10.42; from 5.11 before 5.12.9; 5.13

## Every score

- Linux: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://git.kernel.org/stable/c/0f2cb08c57edefb0e7b5045e0e3e9980a3d3aa37> (patch)
- <https://git.kernel.org/stable/c/ce5355f140a7987011388c7e30c4f8fbe180d3e8> (patch)
- <https://git.kernel.org/stable/c/caff86f85512b8e0d9830e8b8b0dfe13c68ce5b6> (patch)
- <https://git.kernel.org/stable/c/7b22466648a4f8e3e94f57ca428d1531866d1373> (patch)
- <https://git.kernel.org/stable/c/a269333fa5c0c8e53c92b5a28a6076a28cde3e83> (patch)

## Sources

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

---

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