Commit f1811ea
CKI Backport Bot
net/mdiobus: Fix potential out-of-bounds clause 45 read/write access
JIRA: https://issues.redhat.com/browse/RHEL-102094
CVE: CVE-2025-38110
commit 260388f
Author: Jakub Raczynski <j.raczynski@samsung.com>
Date: Mon Jun 9 17:31:47 2025 +0200
net/mdiobus: Fix potential out-of-bounds clause 45 read/write access
When using publicly available tools like 'mdio-tools' to read/write data
from/to network interface and its PHY via C45 (clause 45) mdiobus,
there is no verification of parameters passed to the ioctl and
it accepts any mdio address.
Currently there is support for 32 addresses in kernel via PHY_MAX_ADDR define,
but it is possible to pass higher value than that via ioctl.
While read/write operation should generally fail in this case,
mdiobus provides stats array, where wrong address may allow out-of-bounds
read/write.
Fix that by adding address verification before C45 read/write operation.
While this excludes this access from any statistics, it improves security of
read/write operation.
Fixes: 4e4aafc ("net: mdio: Add dedicated C45 API to MDIO bus drivers")
Signed-off-by: Jakub Raczynski <j.raczynski@samsung.com>
Reported-by: Wenjing Shan <wenjing.shan@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com>1 parent 134517e commit f1811ea
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
979 | 979 | | |
980 | 980 | | |
981 | 981 | | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
982 | 985 | | |
983 | 986 | | |
984 | 987 | | |
| |||
1010 | 1013 | | |
1011 | 1014 | | |
1012 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1013 | 1019 | | |
1014 | 1020 | | |
1015 | 1021 | | |
| |||
0 commit comments