ethernet: hisilicon: hns: hns_dsaf_misc: fix a possible array overflow in hns_dsaf_ge_srst_by_port()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 850bfa3b78ea8849fef78ed74f5f2ccf947db0ca · < fc7ffa7f10b9454a86369405d9814bf141b30627| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ethernet: hisilicon: hns: hns_dsaf_misc: fix a possible array overflow in hns_dsaf_ge_srst_by_port()
The if statement: if (port >= DSAF_GE_NUM) return;
limits the value of port less than DSAF_GE_NUM (i.e., 8). However, if the value of port is 6 or 7, an array overflow could occur: port_rst_off = dsaf_dev->mac_cb[port]->port_rst_off;
because the length of dsaf_dev->mac_cb is DSAF_MAX_PORT_NUM (i.e., 6).
To fix this possible array overflow, we first check port and if it is greater than or equal to DSAF_MAX_PORT_NUM, the function returns.
From the CVE record · Linux
The Linux kernel's Hisilicon HNS Ethernet driver can access past the end of an array when hns_dsaf_ge_srst_by_port() receives port 6 or 7. The input does not specify how an attacker could trigger this condition or whether network access, authentication, or user interaction is required.
Engineers running the Linux kernel with the Hisilicon HNS Ethernet driver should check their systems; affected versions are not specified.