[PATCH net v1 0/2] net/sched: fix action batch failure cleanup

Xuanqiang Luo posted 2 patches 2 weeks, 2 days ago
net/sched/act_api.c                           |  9 +--
.../tc-tests/actions/gact-rollback.json       | 78 +++++++++++++++++++
2 files changed, 80 insertions(+), 7 deletions(-)
create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/gact-rollback.json
[PATCH net v1 0/2] net/sched: fix action batch failure cleanup
Posted by Xuanqiang Luo 2 weeks, 2 days ago
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>

Failed batched RTM_NEWACTION requests can leak action references and
reserved IDR indices when cleanup encounters a filter-bound action.

Patch 1 fixes the failure cleanup.

Patch 2 adds tc-testing regression coverage.

Failure reproduction (key output excerpts):

  python3 tdc.py -f tc-tests/actions/gact-rollback.json

not ok 1 e3b1 - Failed action batch releases a bound action reference
	Could not match regex pattern. Verify command output:
[...]
	 index 1 ref 3 bind 1

not ok 2 e3b2 - Failed action batch releases entries after a bound action
	Command exited with 255, expected 0
RTNETLINK answers: Resource temporarily unavailable
We have an error talking to the kernel

not ok 3 e3b3 - Failed action batch releases repeated references to a bound action
	Could not match regex pattern. Verify command output:
[...]
	 index 1 ref 4 bind 1

Xuanqiang Luo (2):
  net/sched: act_api: release all action references on NEWACTION failure
  selftests: tc-testing: test action batch failure cleanup

 net/sched/act_api.c                           |  9 +--
 .../tc-tests/actions/gact-rollback.json       | 78 +++++++++++++++++++
 2 files changed, 80 insertions(+), 7 deletions(-)
 create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/gact-rollback.json


base-commit: a401a9d547c50ef34db1088cc1fb9a201a7af657
-- 
2.43.0
Re: [PATCH net v1 0/2] net/sched: fix action batch failure cleanup
Posted by Jamal Hadi Salim 2 weeks, 2 days ago
On Wed, Sep 9, 2026 at 3:04 AM Xuanqiang Luo <xuanqiang.luo@linux.dev> wrote:
>
> From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
>
> Failed batched RTM_NEWACTION requests can leak action references and
> reserved IDR indices when cleanup encounters a filter-bound action.
>
> Patch 1 fixes the failure cleanup.
>
> Patch 2 adds tc-testing regression coverage.
>
> Failure reproduction (key output excerpts):
>
>   python3 tdc.py -f tc-tests/actions/gact-rollback.json
>
> not ok 1 e3b1 - Failed action batch releases a bound action reference
>         Could not match regex pattern. Verify command output:
> [...]
>          index 1 ref 3 bind 1
>
> not ok 2 e3b2 - Failed action batch releases entries after a bound action
>         Command exited with 255, expected 0
> RTNETLINK answers: Resource temporarily unavailable
> We have an error talking to the kernel
>
> not ok 3 e3b3 - Failed action batch releases repeated references to a bound action
>         Could not match regex pattern. Verify command output:
> [...]
>          index 1 ref 4 bind 1
>

Thank you for providing a reproducer.
For the series:
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal
> Xuanqiang Luo (2):
>   net/sched: act_api: release all action references on NEWACTION failure
>   selftests: tc-testing: test action batch failure cleanup
>
>  net/sched/act_api.c                           |  9 +--
>  .../tc-tests/actions/gact-rollback.json       | 78 +++++++++++++++++++
>  2 files changed, 80 insertions(+), 7 deletions(-)
>  create mode 100644 tools/testing/selftests/tc-testing/tc-tests/actions/gact-rollback.json
>
>
> base-commit: a401a9d547c50ef34db1088cc1fb9a201a7af657
> --
> 2.43.0
>