CVE-2021-47159
JSON

7.8high

net: dsa: fix a crash if ->get_sset_count() fails

Severity
7.8high CVSS:3.1 by Linux
Exploit likelihood
0.25% (higher than 17% of CVEs; EPSS, by FIRST)
Published
Last changed
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.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 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 *
CVE List
linux linux_kernelfrom 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.13NVD

All scores

Linux7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-835

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: net: dsa: corrige un bloqueo si ->get_sset_count() falla. Si ds->ops->get_sset_count() falla, entonces "count" es un código de error negativo como - EOPNOTSUPP. Debido a que "i" es un int sin signo, el código de error negativo se promociona a un valor muy alto y el bucle corromperá la memoria hasta que el sistema falle. Solucione este problema buscando códigos de error y cambiando el tipo de "i" a solo int.

References

Sources

SourceRecordLicence
CVE ListCVE-2021-47159 changed 2026-08-05CVE Terms of Use
NVDCVE-2021-47159 changed 2026-08-04Public domain