Bug 2208960 - [ovs bonding]bond-miimon-interval allow input negative integer
Summary: [ovs bonding]bond-miimon-interval allow input negative integer
Keywords:
Status: CLOSED DUPLICATE of bug 1990130
Alias: None
Product: Red Hat Enterprise Linux Fast Datapath
Classification: Red Hat
Component: openvswitch3.1
Version: RHEL 9.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Michael Santana
QA Contact: mhou
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-22 08:05 UTC by mhou
Modified: 2023-05-24 16:33 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-24 16:33:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FD-2894 0 None None None 2023-05-22 08:06:02 UTC

Description mhou 2023-05-22 08:05:35 UTC
Description of problem:
bond-miimon-interval allow input negative integer

Version-Release number of selected component (if applicable):
kernel version: 5.14.0-316.el9.x86_64
openvswitch version: openvswitch3.1-3.1.0-14.el9fdp
# ethtool -i ens4f0
driver: i40e
version: 5.14.0-316.el9.x86_64
firmware-version: 9.20 0x8000d89c 1.3353.0
expansion-rom-version: 
bus-info: 0000:af:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes

# ethtool -i ens4f1
driver: i40e
version: 5.14.0-316.el9.x86_64
firmware-version: 9.20 0x8000d89c 1.3353.0
expansion-rom-version: 
bus-info: 0000:af:00.1
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: yes


How reproducible: 100%


Steps to Reproduce:
1. create active-backup bond port with other-config:bond-detect-mode=miimon and other-config:bond-miimon-interval=-100
ovs-vsctl set Open_vSwitch . other_config={}
ovs-vsctl --if-exists del-br bondbridge
ovs-vsctl --may-exist add-br bondbridge
ovs-vsctl add-bond bondbridge active-backup ens4f0 ens4f1 lacp=active bond_mode=active-backup  -- set Interface ens4f0 mtu_request=9000  -- set Interface ens4f1 mtu_request=9000  

ovs-vsctl set port active-backup other-config:bond-detect-mode=miimon 
ovs-vsctl set Port active-backup other_config:bond-miimon-interval=-100

2. check the bond-miimon-interval from ovs-vsctl
# ovs-vsctl list port active-backup
_uuid               : 2cc2ed85-7140-444d-b9c9-c1c4ed19f8f0
bond_active_slave   : "3c:fd:fe:bd:1c:a5"
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : active-backup
bond_updelay        : 0
cvlans              : []
external_ids        : {}
fake_bridge         : false
interfaces          : [2b97428f-2250-4b47-88fe-9dacfcda7859, 5a816dbb-53c0-4573-80e0-068df02d2f4f]
lacp                : off
mac                 : []
name                : active-backup
other_config        : {bond-detect-mode=miimon, bond-miimon-interval="-100"}
protected           : false
qos                 : []
rstp_statistics     : {}
rstp_status         : {}
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []


Actual results:
1. allow input negative integer on bond-miimon-interval

Expected results:
1. Entering negative integer has no practical meaning. Whether ovs should reject negative integer input.

Additional info:

Comment 1 Mike Pattrick 2023-05-24 14:30:37 UTC
Currently OVS doesn't validate any of the key-values in other_config on entry. You could even set that to an alphabetic string.

I believe @msantana was looking into this?

Comment 2 Michael Santana 2023-05-24 16:32:25 UTC
Yes, I was looking into this. The problem is like Mike said the key-values are not validated. The validation (if any) depends on the function that gets those parameters. It may decide to simply ignore invalid parameters and let the user know via logs, or it might not. It's really function dependent. There isnt a global argument verification that tells the user they input something invalid

Im marking this as a duplicate of BZ1990130. The fix for both is the same. OVS needs to implement key:value verification on other_config including integer/float range, multiple choice strings, any string, any non-empty string

Comment 3 Michael Santana 2023-05-24 16:33:06 UTC

*** This bug has been marked as a duplicate of bug 1990130 ***


Note You need to log in before you can comment on or make changes to this bug.