| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/25 21:38 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies selftests (tools/testing/selftests/net/openvswitch/*) and does not make any functional changes to the kernel code itself.",
"WorthFuzzing": false
} |
| 1/1 | 2026/07/25 21:38 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit c79ad8b061892e48234093f7d6b2a9b87e867a2b\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sat Jul 25 21:38:20 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh\nindex 853dbc1b00d7ab..b448324527d8b0 100755\n--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh\n+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh\n@@ -34,6 +34,7 @@ tests=\"\n \taction_set\t\t\t\tset: SET action rewrites fields\n \ttrunc\t\t\t\t\ttrunc: output truncation\n \ticmpv6\t\t\t\t\ticmpv6: ICMPv6 echo type match\n+\tsctp_connect_v4\t\t\t\tsctp: SCTP flow key matching\n \tpsample\t\t\t\t\tpsample: Sampling packets with psample\"\n \n info() {\n@@ -611,6 +612,126 @@ test_icmpv6() {\n \treturn 0\n }\n \n+# Check for an SCTP endpoint via /proc, which works without sctp_diag.\n+sctp_eps_has() {\n+\tip netns exec \"$1\" awk -v p=\"$2\" '$6==p' /proc/net/sctp/eps | grep -q .\n+}\n+\n+# sctp_connect_v4 test\n+# - sctp(dst=4443) matches client-to-server INIT\n+# - sctp(src=4443) matches server-to-client INIT-ACK\n+# - remove flows and verify connection fails, reinstall and recover\n+test_sctp_connect_v4() {\n+\tlocal t=\"test_sctp_connect_v4\"\n+\tlocal srv_ip=172.31.110.20\n+\n+\tmodprobe -q sctp 2\u003e/dev/null || return \"$ksft_skip\"\n+\tsocat -V 2\u003e\u00261 | grep -q \"define WITH_SCTP\" || return \"$ksft_skip\"\n+\n+\tsbx_add \"$t\" || return $?\n+\tovs_add_dp \"$t\" sctp4 || return 1\n+\n+\tinfo \"create namespaces\"\n+\tfor ns in client server; do\n+\t\tovs_add_netns_and_veths \"$t\" \"sctp4\" \"$ns\" \\\n+\t\t \"${ns:0:1}0\" \"${ns:0:1}1\" || return 1\n+\tdone\n+\n+\tip netns exec client ip addr add 172.31.110.10/24 dev c1\n+\tip netns exec client ip link set c1 up\n+\tip netns exec server ip addr add \"${srv_ip}/24\" dev s1\n+\tip netns exec server ip link set s1 up\n+\n+\t# Probe: check if kernel supports sctp flow key.\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(1),eth(),eth_type(0x0800),ipv4(proto=132),sctp(dst=4443)' \\\n+\t '2' \u0026\u003e/dev/null\n+\tif [ $? -ne 0 ]; then\n+\t\tinfo \"no support for sctp key - skipping\"\n+\t\tovs_exit_sig\n+\t\treturn $ksft_skip\n+\tfi\n+\tovs_del_flows \"$t\" sctp4\n+\n+\t# ARP forwarding\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(1),eth(),eth_type(0x0806),arp()' \\\n+\t '2' || return 1\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(2),eth(),eth_type(0x0806),arp()' \\\n+\t '1' || return 1\n+\n+\t# SCTP port matching: dst for request, src for reply\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(1),eth(),eth_type(0x0800),ipv4(proto=132),sctp(dst=4443)' \\\n+\t '2' || return 1\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(2),eth(),eth_type(0x0800),ipv4(proto=132),sctp(src=4443)' \\\n+\t '1' || return 1\n+\n+\tovs_netns_spawn_daemon \"$t\" \"server\" \\\n+\t socat -u SCTP4-LISTEN:4443 STDOUT\n+\tlocal server_pid=\"$pid\"\n+\tovs_wait sctp_eps_has server 4443 || return 1\n+\n+\tinfo \"verify SCTP association with port-keyed flows\"\n+\tovs_sbx \"$t\" ip netns exec client \\\n+\t timeout 3 socat -u STDIN \"SCTP4-CONNECT:${srv_ip}:4443\" \u003c/dev/null \\\n+\t || return 1\n+\n+\tovs_del_flows \"$t\" sctp4\n+\n+\tinfo \"verify connection fails without flows\"\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(1),eth(),eth_type(0x0806),arp()' \\\n+\t '2' || return 1\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(2),eth(),eth_type(0x0806),arp()' \\\n+\t '1' || return 1\n+\n+\tkill -TERM \"$server_pid\" 2\u003e/dev/null\n+\tlocal i=0\n+\twhile kill -0 \"$server_pid\" 2\u003e/dev/null \u0026\u0026 [ \"$i\" -lt 5 ]; do\n+\t sleep 0.2\n+\t i=$((i + 1))\n+\tdone\n+\tovs_netns_spawn_daemon \"$t\" \"server\" \\\n+\t socat -u SCTP4-LISTEN:4443 STDOUT\n+\tserver_pid=\"$pid\"\n+\tovs_wait sctp_eps_has server 4443 || return 1\n+\n+\tovs_sbx \"$t\" ip netns exec client \\\n+\t timeout 3 socat -u STDIN \"SCTP4-CONNECT:${srv_ip}:4443\" \u003c/dev/null \\\n+\t \u003e/dev/null 2\u003e\u00261 \\\n+\t \u0026\u0026 { info \"connection should fail without flows\"\n+\t return 1; }\n+\n+\tinfo \"reinstall flows and verify recovery\"\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(1),eth(),eth_type(0x0800),ipv4(proto=132),sctp(dst=4443)' \\\n+\t '2' || return 1\n+\tovs_add_flow \"$t\" sctp4 \\\n+\t 'in_port(2),eth(),eth_type(0x0800),ipv4(proto=132),sctp(src=4443)' \\\n+\t '1' || return 1\n+\n+\tkill -TERM \"$server_pid\" 2\u003e/dev/null\n+\ti=0\n+\twhile kill -0 \"$server_pid\" 2\u003e/dev/null \u0026\u0026 [ \"$i\" -lt 5 ]; do\n+\t sleep 0.2\n+\t i=$((i + 1))\n+\tdone\n+\tovs_netns_spawn_daemon \"$t\" \"server\" \\\n+\t socat -u SCTP4-LISTEN:4443 STDOUT\n+\tserver_pid=\"$pid\"\n+\tovs_wait sctp_eps_has server 4443 || return 1\n+\n+\tovs_sbx \"$t\" ip netns exec client \\\n+\t timeout 3 socat -u STDIN \"SCTP4-CONNECT:${srv_ip}:4443\" \u003c/dev/null \\\n+\t || return 1\n+\n+\treturn 0\n+}\n+\n # psample test\n # - use psample to observe packets\n test_psample() {\ndiff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\nindex f3edd198223f17..633af10d7e8ab2 100644\n--- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\n+++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py\n@@ -15,6 +15,7 @@ import struct\n import sys\n import time\n import types\n+import unittest\n import uuid\n \n try:\n@@ -1984,6 +1985,11 @@ class ovskey(nla):\n \"udp\",\n ovskey.ovs_key_udp,\n ),\n+ (\n+ \"OVS_KEY_ATTR_SCTP\",\n+ \"sctp\",\n+ ovskey.ovs_key_sctp,\n+ ),\n (\n \"OVS_KEY_ATTR_ICMP\",\n \"icmp\",\n@@ -3165,5 +3171,128 @@ def main(argv):\n return 0\n \n \n+def _init_ovskey_nlas():\n+ \"\"\"Initialize required NLA classes for ovskey parsing.\"\"\"\n+ nlmsg_atoms.encap_ovskey = encap_ovskey\n+ nlmsg_atoms.ovskey = ovskey\n+ nlmsg_atoms.ovsactions = ovsactions\n+\n+\n+def _parse_flow(flowstr):\n+ \"\"\"Parse a flow string and return the key.\"\"\"\n+ key = ovskey()\n+ key[\"attrs\"] = []\n+ key.parse(flowstr)\n+ return key\n+\n+\n+def _find_attr(key, attr_name):\n+ \"\"\"Find an attribute in parsed key.\"\"\"\n+ for attr in key[\"attrs\"]:\n+ if attr[0] == attr_name:\n+ return attr[1]\n+ return None\n+\n+\n+class TestOvsKeyParse(unittest.TestCase):\n+ \"\"\"Unit tests for ovskey.parse() flow string parsing.\"\"\"\n+\n+ @classmethod\n+ def setUpClass(cls):\n+ _init_ovskey_nlas()\n+\n+ def test_sctp_dst(self):\n+ \"\"\"Test SCTP destination port parsing.\"\"\"\n+ key = _parse_flow(\"sctp(dst=4443)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_SCTP\")\n+ self.assertIsNotNone(attr, \"SCTP key not found\")\n+ self.assertEqual(attr[\"dst\"], 4443)\n+\n+ def test_sctp_src(self):\n+ \"\"\"Test SCTP source port parsing.\"\"\"\n+ key = _parse_flow(\"sctp(src=4443)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_SCTP\")\n+ self.assertIsNotNone(attr, \"SCTP key not found\")\n+ self.assertEqual(attr[\"src\"], 4443)\n+\n+ def test_sctp_src_and_dst(self):\n+ \"\"\"Test SCTP source and destination port parsing.\"\"\"\n+ key = _parse_flow(\"sctp(src=1234,dst=5678)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_SCTP\")\n+ self.assertIsNotNone(attr, \"SCTP key not found\")\n+ self.assertEqual(attr[\"src\"], 1234)\n+ self.assertEqual(attr[\"dst\"], 5678)\n+\n+ def test_tcp_dst(self):\n+ \"\"\"Test TCP destination port parsing.\"\"\"\n+ key = _parse_flow(\"tcp(dst=80)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_TCP\")\n+ self.assertIsNotNone(attr, \"TCP key not found\")\n+ self.assertEqual(attr[\"dst\"], 80)\n+\n+ def test_udp_dst(self):\n+ \"\"\"Test UDP destination port parsing.\"\"\"\n+ key = _parse_flow(\"udp(dst=53)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_UDP\")\n+ self.assertIsNotNone(attr, \"UDP key not found\")\n+ self.assertEqual(attr[\"dst\"], 53)\n+\n+ def test_icmp_type_code(self):\n+ \"\"\"Test ICMP type and code parsing.\"\"\"\n+ key = _parse_flow(\"icmp(type=8,code=0)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_ICMP\")\n+ self.assertIsNotNone(attr, \"ICMP key not found\")\n+ self.assertEqual(attr[\"type\"], 8)\n+ self.assertEqual(attr[\"code\"], 0)\n+\n+ def test_ipv4_proto(self):\n+ \"\"\"Test IPv4 protocol parsing.\"\"\"\n+ key = _parse_flow(\"eth_type(0x0800),ipv4(proto=132)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_IPV4\")\n+ self.assertIsNotNone(attr, \"IPv4 key not found\")\n+ self.assertEqual(attr[\"proto\"], 132)\n+\n+ def test_eth_type(self):\n+ \"\"\"Test Ethernet type parsing.\"\"\"\n+ key = _parse_flow(\"eth_type(0x0800)\")\n+ attr = _find_attr(key, \"OVS_KEY_ATTR_ETHERTYPE\")\n+ self.assertIsNotNone(attr, \"EthType key not found\")\n+ self.assertEqual(attr, 0x0800)\n+\n+ def test_full_sctp_flow(self):\n+ \"\"\"Test complete SCTP flow string parsing.\"\"\"\n+ flowstr = (\n+ \"in_port(1),eth(),eth_type(0x0800),\"\n+ \"ipv4(proto=132),sctp(dst=4443)\"\n+ )\n+ key = _parse_flow(flowstr)\n+ in_port = _find_attr(key, \"OVS_KEY_ATTR_IN_PORT\")\n+ self.assertEqual(in_port, 1)\n+ sctp = _find_attr(key, \"OVS_KEY_ATTR_SCTP\")\n+ self.assertIsNotNone(sctp, \"SCTP key not found\")\n+ self.assertEqual(sctp[\"dst\"], 4443)\n+\n+ def test_sctp_roundtrip(self):\n+ \"\"\"Test parse -\u003e dpstr -\u003e parse keeps the SCTP key.\"\"\"\n+ key = _parse_flow(\"sctp(dst=4443)\")\n+ key2 = ovskey()\n+ key2[\"attrs\"] = []\n+ remainder = key2.parse(key.dpstr())\n+ self.assertEqual(remainder, \"\", \"round-trip left unparsed text\")\n+ attr = _find_attr(key2, \"OVS_KEY_ATTR_SCTP\")\n+ self.assertIsNotNone(attr, \"SCTP key lost in round-trip\")\n+ self.assertEqual(attr[\"dst\"], 4443)\n+\n+\n+def test_ovskey_parse():\n+ \"\"\"Test ovskey.parse() method for various flow key types.\"\"\"\n+ suite = unittest.TestLoader().loadTestsFromTestCase(TestOvsKeyParse)\n+ runner = unittest.TextTestRunner(verbosity=2)\n+ result = runner.run(suite)\n+ return 0 if result.wasSuccessful() else 1\n+\n+\n if __name__ == \"__main__\":\n+ if len(sys.argv) \u003e 1 and sys.argv[1] == \"--test\":\n+ sys.exit(test_ovskey_parse())\n sys.exit(main(sys.argv))\n"
} |
| 2/1 | 2026/07/25 21:38 | agent | patch-evaluator |
0mModel:best-expensive Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies selftests (tools/testing/selftests/net/openvswitch/*) and does not make any functional changes to the kernel code itself.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit c79ad8b061892e48234093f7d6b2a9b87e867a2b
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Jul 25 21:38:20 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh
index 853dbc1b00d7ab..b448324527d8b0 100755
--- a/tools/testing/selftests/net/openvswitch/openvswitch.sh
+++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh
@@ -34,6 +34,7 @@ tests="
action_set set: SET action rewrites fields
trunc trunc: output truncation
icmpv6 icmpv6: ICMPv6 echo type match
+ sctp_connect_v4 sctp: SCTP flow key matching
psample psample: Sampling packets with psample"
info() {
@@ -611,6 +612,126 @@ test_icmpv6() {
return 0
}
+# Check for an SCTP endpoint via /proc, which works without sctp_diag.
+sctp_eps_has() {
+ ip netns exec "$1" awk -v p="$2" '$6==p' /proc/net/sctp/eps | grep -q .
+}
+
+# sctp_connect_v4 test
+# - sctp(dst=4443) matches client-to-server INIT
+# - sctp(src=4443) matches server-to-client INIT-ACK
+# - remove flows and verify connection fails, reinstall and recover
+test_sctp_connect_v4() {
+ local t="test_sctp_connect_v4"
+ local srv_ip=172.31.110.20
+
+ modprobe -q sctp 2>/dev/null || return "$ksft_skip"
+ socat -V 2>&1 | grep -q "define WITH_SCTP" || return "$ksft_skip"
+
+ sbx_add "$t" || return $?
+ ovs_add_dp "$t" sctp4 || return 1
+
+ info "create namespaces"
+ for ns in client server; do
+ ovs_add_netns_and_veths "$t" "sctp4" "$ns" \
+ "${ns:0:1}0" "${ns:0:1}1" || return 1
+ done
+
+ ip netns exec client ip addr add 172.31.110.10/24 dev c1
+ ip netns exec client ip link set c1 up
+ ip netns exec server ip addr add "${srv_ip}/24" dev s1
+ ip netns exec server ip link set s1 up
+
+ # Probe: check if kernel supports sctp flow key.
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(1),eth(),eth_type(0x0800),ipv4(proto=132),sctp(dst=4443)' \
+ '2' &>/dev/null
+ if [ $? -ne 0 ]; then
+ info "no support for sctp key - skipping"
+ ovs_exit_sig
+ return $ksft_skip
+ fi
+ ovs_del_flows "$t" sctp4
+
+ # ARP forwarding
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(1),eth(),eth_type(0x0806),arp()' \
+ '2' || return 1
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(2),eth(),eth_type(0x0806),arp()' \
+ '1' || return 1
+
+ # SCTP port matching: dst for request, src for reply
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(1),eth(),eth_type(0x0800),ipv4(proto=132),sctp(dst=4443)' \
+ '2' || return 1
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(2),eth(),eth_type(0x0800),ipv4(proto=132),sctp(src=4443)' \
+ '1' || return 1
+
+ ovs_netns_spawn_daemon "$t" "server" \
+ socat -u SCTP4-LISTEN:4443 STDOUT
+ local server_pid="$pid"
+ ovs_wait sctp_eps_has server 4443 || return 1
+
+ info "verify SCTP association with port-keyed flows"
+ ovs_sbx "$t" ip netns exec client \
+ timeout 3 socat -u STDIN "SCTP4-CONNECT:${srv_ip}:4443" </dev/null \
+ || return 1
+
+ ovs_del_flows "$t" sctp4
+
+ info "verify connection fails without flows"
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(1),eth(),eth_type(0x0806),arp()' \
+ '2' || return 1
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(2),eth(),eth_type(0x0806),arp()' \
+ '1' || return 1
+
+ kill -TERM "$server_pid" 2>/dev/null
+ local i=0
+ while kill -0 "$server_pid" 2>/dev/null && [ "$i" -lt 5 ]; do
+ sleep 0.2
+ i=$((i + 1))
+ done
+ ovs_netns_spawn_daemon "$t" "server" \
+ socat -u SCTP4-LISTEN:4443 STDOUT
+ server_pid="$pid"
+ ovs_wait sctp_eps_has server 4443 || return 1
+
+ ovs_sbx "$t" ip netns exec client \
+ timeout 3 socat -u STDIN "SCTP4-CONNECT:${srv_ip}:4443" </dev/null \
+ >/dev/null 2>&1 \
+ && { info "connection should fail without flows"
+ return 1; }
+
+ info "reinstall flows and verify recovery"
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(1),eth(),eth_type(0x0800),ipv4(proto=132),sctp(dst=4443)' \
+ '2' || return 1
+ ovs_add_flow "$t" sctp4 \
+ 'in_port(2),eth(),eth_type(0x0800),ipv4(proto=132),sctp(src=4443)' \
+ '1' || return 1
+
+ kill -TERM "$server_pid" 2>/dev/null
+ i=0
+ while kill -0 "$server_pid" 2>/dev/null && [ "$i" -lt 5 ]; do
+ sleep 0.2
+ i=$((i + 1))
+ done
+ ovs_netns_spawn_daemon "$t" "server" \
+ socat -u SCTP4-LISTEN:4443 STDOUT
+ server_pid="$pid"
+ ovs_wait sctp_eps_has server 4443 || return 1
+
+ ovs_sbx "$t" ip netns exec client \
+ timeout 3 socat -u STDIN "SCTP4-CONNECT:${srv_ip}:4443" </dev/null \
+ || return 1
+
+ return 0
+}
+
# psample test
# - use psample to observe packets
test_psample() {
diff --git a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
index f3edd198223f17..633af10d7e8ab2 100644
--- a/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
+++ b/tools/testing/selftests/net/openvswitch/ovs-dpctl.py
@@ -15,6 +15,7 @@ import struct
import sys
import time
import types
+import unittest
import uuid
try:
@@ -1984,6 +1985,11 @@ class ovskey(nla):
"udp",
ovskey.ovs_key_udp,
),
+ (
+ "OVS_KEY_ATTR_SCTP",
+ "sctp",
+ ovskey.ovs_key_sctp,
+ ),
(
"OVS_KEY_ATTR_ICMP",
"icmp",
@@ -3165,5 +3171,128 @@ def main(argv):
return 0
+def _init_ovskey_nlas():
+ """Initialize required NLA classes for ovskey parsing."""
+ nlmsg_atoms.encap_ovskey = encap_ovskey
+ nlmsg_atoms.ovskey = ovskey
+ nlmsg_atoms.ovsactions = ovsactions
+
+
+def _parse_flow(flowstr):
+ """Parse a flow string and return the key."""
+ key = ovskey()
+ key["attrs"] = []
+ key.parse(flowstr)
+ return key
+
+
+def _find_attr(key, attr_name):
+ """Find an attribute in parsed key."""
+ for attr in key["attrs"]:
+ if attr[0] == attr_name:
+ return attr[1]
+ return None
+
+
+class TestOvsKeyParse(unittest.TestCase):
+ """Unit tests for ovskey.parse() flow string parsing."""
+
+ @classmethod
+ def setUpClass(cls):
+ _init_ovskey_nlas()
+
+ def test_sctp_dst(self):
+ """Test SCTP destination port parsing."""
+ key = _parse_flow("sctp(dst=4443)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_SCTP")
+ self.assertIsNotNone(attr, "SCTP key not found")
+ self.assertEqual(attr["dst"], 4443)
+
+ def test_sctp_src(self):
+ """Test SCTP source port parsing."""
+ key = _parse_flow("sctp(src=4443)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_SCTP")
+ self.assertIsNotNone(attr, "SCTP key not found")
+ self.assertEqual(attr["src"], 4443)
+
+ def test_sctp_src_and_dst(self):
+ """Test SCTP source and destination port parsing."""
+ key = _parse_flow("sctp(src=1234,dst=5678)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_SCTP")
+ self.assertIsNotNone(attr, "SCTP key not found")
+ self.assertEqual(attr["src"], 1234)
+ self.assertEqual(attr["dst"], 5678)
+
+ def test_tcp_dst(self):
+ """Test TCP destination port parsing."""
+ key = _parse_flow("tcp(dst=80)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_TCP")
+ self.assertIsNotNone(attr, "TCP key not found")
+ self.assertEqual(attr["dst"], 80)
+
+ def test_udp_dst(self):
+ """Test UDP destination port parsing."""
+ key = _parse_flow("udp(dst=53)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_UDP")
+ self.assertIsNotNone(attr, "UDP key not found")
+ self.assertEqual(attr["dst"], 53)
+
+ def test_icmp_type_code(self):
+ """Test ICMP type and code parsing."""
+ key = _parse_flow("icmp(type=8,code=0)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_ICMP")
+ self.assertIsNotNone(attr, "ICMP key not found")
+ self.assertEqual(attr["type"], 8)
+ self.assertEqual(attr["code"], 0)
+
+ def test_ipv4_proto(self):
+ """Test IPv4 protocol parsing."""
+ key = _parse_flow("eth_type(0x0800),ipv4(proto=132)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_IPV4")
+ self.assertIsNotNone(attr, "IPv4 key not found")
+ self.assertEqual(attr["proto"], 132)
+
+ def test_eth_type(self):
+ """Test Ethernet type parsing."""
+ key = _parse_flow("eth_type(0x0800)")
+ attr = _find_attr(key, "OVS_KEY_ATTR_ETHERTYPE")
+ self.assertIsNotNone(attr, "EthType key not found")
+ self.assertEqual(attr, 0x0800)
+
+ def test_full_sctp_flow(self):
+ """Test complete SCTP flow string parsing."""
+ flowstr = (
+ "in_port(1),eth(),eth_type(0x0800),"
+ "ipv4(proto=132),sctp(dst=4443)"
+ )
+ key = _parse_flow(flowstr)
+ in_port = _find_attr(key, "OVS_KEY_ATTR_IN_PORT")
+ self.assertEqual(in_port, 1)
+ sctp = _find_attr(key, "OVS_KEY_ATTR_SCTP")
+ self.assertIsNotNone(sctp, "SCTP key not found")
+ self.assertEqual(sctp["dst"], 4443)
+
+ def test_sctp_roundtrip(self):
+ """Test parse -> dpstr -> parse keeps the SCTP key."""
+ key = _parse_flow("sctp(dst=4443)")
+ key2 = ovskey()
+ key2["attrs"] = []
+ remainder = key2.parse(key.dpstr())
+ self.assertEqual(remainder, "", "round-trip left unparsed text")
+ attr = _find_attr(key2, "OVS_KEY_ATTR_SCTP")
+ self.assertIsNotNone(attr, "SCTP key lost in round-trip")
+ self.assertEqual(attr["dst"], 4443)
+
+
+def test_ovskey_parse():
+ """Test ovskey.parse() method for various flow key types."""
+ suite = unittest.TestLoader().loadTestsFromTestCase(TestOvsKeyParse)
+ runner = unittest.TextTestRunner(verbosity=2)
+ result = runner.run(suite)
+ return 0 if result.wasSuccessful() else 1
+
+
if __name__ == "__main__":
+ if len(sys.argv) > 1 and sys.argv[1] == "--test":
+ sys.exit(test_ovskey_parse())
sys.exit(main(sys.argv))
|
| 3/2 | 2026/07/25 21:38 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 5932 output: 67 thoughts: 292 Thoughts: **Assessing the Need for Fuzzing** Okay, let's break this down. My initial assessment is that we need to determine if this patch necessitates fuzzing due to functional changes within the kernel. The files modified are `tools/testing/selftests/net/openvswitch/openvswitch.sh` and `tools/testing/selftests/net/openvswitch/ovs-dpctl.py`. These are selftests for Open vSwitch. I need to be absolutely certain though; there are *no* changes to any kernel source code, specifically within a directory like `net/openvswitch/`. Alright, a quick review of the diff confirms: it is indeed limited to those selftest files. Since this patch *exclusively* modifies selftests, this means it doesn't make any functional changes to the kernel's core behavior. No kernel-level code is being altered here. Therefore, my conclusion is clear: `WorthFuzzing` should be set to `false`. Just to be thorough, I'm going to quickly verify the diff to make absolutely certain that no other files are included. Yep, just the two files: `tools/testing/selftests/net/openvswitch/openvswitch.sh` and `tools/testing/selftests/net/openvswitch/ovs-dpctl.py`. No kernel code is touched. Alright, I'm confident in my assessment. I'll return `WorthFuzzing = false`, explaining that this patch exclusively involves modifications to selftests, and therefore does not impact the kernel's functionality in a manner that requires fuzzing. |
| 4/2 | 2026/07/25 21:38 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch only modifies selftests (tools/testing/selftests/net/openvswitch/*) and does not make any functional changes to the kernel code itself.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch only modifies selftests (tools/testing/selftests/net/openvswitch/*) and does not make any functional changes to the kernel code itself.",
"WorthFuzzing": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|