Commit 033ec00
committed
octeon_ep: Validate the VF ID
JIRA: https://issues.redhat.com/browse/RHEL-113707
commit af82e85
Author: Kamal Heib <kheib@redhat.com>
Date: Thu Sep 11 18:36:10 2025 -0400
octeon_ep: Validate the VF ID
Add a helper to validate the VF ID and use it in the VF ndo ops to
prevent accessing out-of-range entries.
Without this check, users can run commands such as:
# ip link show dev enp135s0
2: enp135s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether 00:00:00:01:01:00 brd ff:ff:ff:ff:ff:ff
vf 0 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
vf 1 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state enable, trust off
# ip link set dev enp135s0 vf 4 mac 00:00:00:00:00:14
# echo $?
0
even though VF 4 does not exist, which results in silent success instead
of returning an error.
Fixes: 8a241ef ("octeon_ep: add ndo ops for VFs in PF driver")
Signed-off-by: Kamal Heib <kheib@redhat.com>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250911223610.1803144-1-kheib@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kamal Heib <kheib@redhat.com>1 parent df8ce83 commit 033ec00
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1124 | 1124 | | |
1125 | 1125 | | |
1126 | 1126 | | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
1127 | 1137 | | |
1128 | 1138 | | |
1129 | 1139 | | |
1130 | 1140 | | |
1131 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1132 | 1145 | | |
1133 | 1146 | | |
1134 | 1147 | | |
| |||
1143 | 1156 | | |
1144 | 1157 | | |
1145 | 1158 | | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
1146 | 1162 | | |
1147 | 1163 | | |
1148 | 1164 | | |
| |||
0 commit comments