BPF List
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jamal Hadi Salim" <jhs@mojatatu.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH net 3/3] selftests/tc-testing: Verify bpf redirect on RED block with preceding clsact (egress) classifier
Date: Sat, 27 Jun 2026 16:52:20 +0000	[thread overview]
Message-ID: <20260627165220.CA0CD1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260626165156.169012-4-jhs@mojatatu.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Hardcoded BPF object path 'action-ebpf' instead of using '$EBPFDIR/action-ebpf'.
--

commit f4ff308069725bd7a3b6c6f843ecb0fda5b73239
Author: Victor Nogueira <victor@mojatatu.com>

selftests/tc-testing: Verify bpf redirect on RED block with preceding clsact (egress) classifier

This commit adds a test case to reproduce a NULL pointer dereference when a
bpf filter attached to a RED block (which uses shared blocks) returns
TC_ACT_REDIRECT while a preceding clsact egress classifier is present. The
issue stems from a stack-allocated bpf_net_context being torn down before
tcf_qevent_handle() calls skb_do_redirect().

> diff --git a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
> index a1f97a4b606e8..762f86ceab1cd 100644
> --- a/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
> +++ b/tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
[ ... ]
> @@ -1540,5 +1540,37 @@
[ ... ]
> +    {
> +        "id": "fb8d",
> +        "name": "Verify bpf redirect on RED block with preceding clsact (egress) classifier",
> +        "category": [
> +            "qdisc",
> +            "red",
> +            "qevent",
> +            "clsact"
> +        ],
> +        "plugins": {
> +            "requires": "nsPlugin"
> +        },
> +        "setup": [
> +            "$IP addr add 10.10.10.1/24 dev $DUMMY",
> +            "$IP neigh add 10.10.10.2 lladdr 02:00:00:00:00:01 dev $DUMMY nud permanent",
> +            "$TC qdisc add dev $DUMMY handle 1: root tbf rate 1Mbit burst 10K limit 1M",
> +            "$TC qdisc add dev $DUMMY parent 1:1 handle 11: red limit 1M avpkt 1400 probability 1 burst 38 harddrop min 30000 max 30001 qevent early_drop block 10",
> +            "$TC qdisc add dev $DUMMY clsact",
> +            "$TC filter add dev $DUMMY egress protocol ip prio 1 matchall action gact pass",
> +            "$TC filter add block 10 protocol ip prio 1 matchall action bpf obj action-ebpf sec action-redirect"

[Severity: Medium]
In the setup block for "Verify bpf redirect on RED block with preceding clsact
(egress) classifier", will this test fail with a file-not-found error when
the tdc.py runner is executed in an out-of-tree build environment or with a
customized $EBPFDIR?

Should this path be updated to use $EBPFDIR/action-ebpf instead of the
hardcoded action-ebpf so it aligns with other tests in the suite and finds
the BPF object correctly?

> +        ],
> +        "cmdUnderTest": "bash -c 'data=$(head -c 1400 /dev/zero | tr \"\\0\" \"x\"); exec 3>/dev/udp/10.10.10.2/12345; for i in $(seq 1 8000); do printf \"%s\" \"$data\" >&3; done; exit 0'",
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260626165156.169012-1-jhs@mojatatu.com?part=3

  reply	other threads:[~2026-06-27 16:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-26 16:51 [PATCH net 0/3] Fix broken TC_ACT_REDIRECT Jamal Hadi Salim
2026-06-26 16:51 ` [PATCH net 1/3] net: Extend bpf_net_context lifetime to cover qdisc enqueue Jamal Hadi Salim
2026-06-27 16:52   ` sashiko-bot
2026-06-28 12:16     ` Jamal Hadi Salim
2026-06-29 10:29   ` Sebastian Andrzej Siewior
2026-06-29 10:47     ` Jamal Hadi Salim
2026-06-26 16:51 ` [PATCH net 2/3] net/sched: Handle TC_ACT_REDIRECT from qdisc filter chains Jamal Hadi Salim
2026-06-27 16:52   ` sashiko-bot
2026-06-28 12:28     ` Jamal Hadi Salim
2026-06-26 16:51 ` [PATCH net 3/3] selftests/tc-testing: Verify bpf redirect on RED block with preceding clsact (egress) classifier Jamal Hadi Salim
2026-06-27 16:52   ` sashiko-bot [this message]
2026-06-28 12:36     ` Jamal Hadi Salim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260627165220.CA0CD1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=jhs@mojatatu.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox