Add tdc test cases that verify a qdisc with an oversized TCA_STAB overhead (2147483000) is rejected. Without the fix, the qdisc is accepted and a single packet drives the deficit loop into a soft lockup; with the fix, the add fails with -EINVAL. Reported-by: vega@nebusec.ai Tested-by: Victor Nogueira Signed-off-by: Jamal Hadi Salim --- .../tc-testing/tc-tests/qdiscs/drr.json | 20 +++++++++++++++++++ .../tc-testing/tc-tests/qdiscs/ets.json | 20 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/drr.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/drr.json index 2b61d8d79bde..7713eb35aaeb 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/drr.json +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/drr.json @@ -86,5 +86,25 @@ "teardown": [ "$TC qdisc del dev $DUMMY root" ] + }, + { + "id": "d1e2", + "name": "Reject DRR qdisc with oversized TCA_STAB overhead", + "category": [ + "qdisc", + "drr" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + ], + "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root stab overhead 2147483000 drr", + "expExitCode": "2", + "verifyCmd": "$TC qdisc show dev $DUMMY", + "matchPattern": "qdisc drr", + "matchCount": "0", + "teardown": [ + ] } ] diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json index ee09e6d6fdf3..da7ae626f7e1 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json +++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/ets.json @@ -1007,5 +1007,25 @@ "teardown": [ "echo \"1\" > /sys/bus/netdevsim/del_device" ] + }, + { + "id": "f3a4", + "name": "Reject ETS qdisc with oversized TCA_STAB overhead", + "category": [ + "qdisc", + "ets" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + ], + "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root stab overhead 2147483000 ets bands 1 strict 0 quanta 1", + "expExitCode": "2", + "verifyCmd": "$TC qdisc show dev $DUMMY", + "matchPattern": "qdisc ets", + "matchCount": "0", + "teardown": [ + ] } ] -- 2.43.0