diff options
| author | Jamal Hadi Salim <jhs@mojatatu.com> | 2026-10-12 14:09:26 -0400 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-10-19 19:39:45 -0700 |
| commit | 044ad3c90d9d2df2c5cb3325ae17b4e9603a311f (patch) | |
| tree | 58123c38e9d3ba0beb2e03dc6a25eb4aa0025731 /tools/testing | |
| parent | f67b3ed1308d7a282e2d6202d61af052ab0da39e (diff) | |
selftests: tc-testing: add duplicate action delete batch test
tca_action_gd() takes one reference per nested TCA_ACT_TAB entry while
tcf_action_delete() consumes two per slot, so three duplicate
TCA_ACT_INDEX entries in one RTM_DELACTION free the action mid-walk and
the next slot dereferences it. Assert a duplicate batch is rejected and
the action survives.
Conditions to recreate the bug:
tc actions add action pass index 1
tc actions delete action gact index 1 action gact index 1 \
action gact index 1
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/QDISC-K1TH.v1.r3.20261012134653-2@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing')
| -rw-r--r-- | tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json index ef7ca4a6775b..7620e927ae2c 100644 --- a/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/batch-delete.json @@ -111,5 +111,38 @@ 255 ] ] + }, + { + "id": "8135", + "name": "Reject duplicate action in a delete batch", + "category": [ + "actions", + "gact" + ], + "plugins": { + "requires": "nsPlugin" + }, + "setup": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ], + "$TC actions add action pass index 1" + ], + "cmdUnderTest": "$TC actions del action gact index 1 action gact index 1 action gact index 1", + "expExitCode": "255", + "verifyCmd": "$TC actions ls action gact", + "matchPattern": "total acts 1\\b.*index 1 ref 1 bind 0\\b", + "matchCount": "1", + "teardown": [ + [ + "$TC actions flush action gact", + 0, + 1, + 255 + ] + ] } ] |
