Skip to content

Commit c478484

Browse files
author
Herton R. Krzesinski
committed
Merge: Revert "ethernet: Remove vf rate limit check for drivers"
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2036 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168599 Upstream-status: RHEL-Only This reverts commit 778c3af. Commit 778c3af ("ethernet: Remove vf rate limit check for drivers") was backported for RHEL9.2 but it has a dependency on upstream commit a14857c ("rtnetlink: verify rate parameters for calls to ndo_set_vf_rate") which has not been backported to RHEL9 at this time. Without this revert, it is possible for a program to pass invalid parameters to the kernel/driver using IFLA_VF_RATE. The 'ip' command is safe because it makes sure that min_tx_rate <= max_tx_rate before calling into the kernel, but other programs could potentially be a problem. Signed-off-by: Ken Cox <jkc@redhat.com> Approved-by: Herton R. Krzesinski <herton@redhat.com> Approved-by: Íñigo Huguet <ihuguet@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents 016b16d + afd1a40 commit c478484

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_sriov.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ int bnxt_set_vf_bw(struct net_device *dev, int vf_id, int min_tx_rate,
307307
return -EINVAL;
308308
}
309309

310-
if (min_tx_rate > pf_link_speed) {
310+
if (min_tx_rate > pf_link_speed || min_tx_rate > max_tx_rate) {
311311
netdev_info(bp->dev, "min tx rate %d is invalid for VF %d\n",
312312
min_tx_rate, vf_id);
313313
return -EINVAL;

0 commit comments

Comments
 (0)