diff options
| author | Aaron Conole <[email protected]> | 2024-02-07 13:24:16 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-02-09 20:54:38 +0000 |
| commit | bd128f62c365504e1268dc09fcccdfb1f091e93a (patch) | |
| tree | 0e9bc6fb2090518ce781dacda64018b89ffe8984 /tools/testing/selftests/net/openvswitch/openvswitch.sh | |
| parent | net: openvswitch: limit the number of recursions from action sets (diff) | |
| download | kernel-bd128f62c365504e1268dc09fcccdfb1f091e93a.tar.gz kernel-bd128f62c365504e1268dc09fcccdfb1f091e93a.zip | |
selftests: openvswitch: Add validation for the recursion test
Add a test case into the netlink checks that will show the number of
nested action recursions won't exceed 16. Going to 17 on a small
clone call isn't enough to exhaust the stack on (most) systems, so
it should be safe to run even on systems that don't have the fix
applied.
Signed-off-by: Aaron Conole <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'tools/testing/selftests/net/openvswitch/openvswitch.sh')
| -rwxr-xr-x | tools/testing/selftests/net/openvswitch/openvswitch.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/testing/selftests/net/openvswitch/openvswitch.sh b/tools/testing/selftests/net/openvswitch/openvswitch.sh index f8499d4c87f3..36e40256ab92 100755 --- a/tools/testing/selftests/net/openvswitch/openvswitch.sh +++ b/tools/testing/selftests/net/openvswitch/openvswitch.sh @@ -502,9 +502,22 @@ test_netlink_checks () { wc -l) == 2 ] || \ return 1 + info "Checking clone depth" ERR_MSG="Flow actions may not be safe on all matching packets" PRE_TEST=$(dmesg | grep -c "${ERR_MSG}") ovs_add_flow "test_netlink_checks" nv0 \ + 'in_port(1),eth(),eth_type(0x800),ipv4()' \ + 'clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(clone(drop)))))))))))))))))' \ + >/dev/null 2>&1 && return 1 + POST_TEST=$(dmesg | grep -c "${ERR_MSG}") + + if [ "$PRE_TEST" == "$POST_TEST" ]; then + info "failed - clone depth too large" + return 1 + fi + + PRE_TEST=$(dmesg | grep -c "${ERR_MSG}") + ovs_add_flow "test_netlink_checks" nv0 \ 'in_port(1),eth(),eth_type(0x0806),arp()' 'drop(0),2' \ &> /dev/null && return 1 POST_TEST=$(dmesg | grep -c "${ERR_MSG}") |
