From: bot+bpf-ci@kernel.org
To: yangfeng59949@163.com,davem@davemloft.net,edumazet@google.com,kuba@kernel.org,pabeni@redhat.com,horms@kernel.org,posk@google.com,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,martin.lau@linux.dev,eddyz87@gmail.com
Cc: bpf@vger.kernel.org,netdev@vger.kernel.org,linux-kernel@vger.kernel.org,linux-kselftest@vger.kernel.org,yangfeng59949@163.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH v7 bpf-next 1/2] bpf: test_run: Fix the null pointer dereference issue in bpf_lwt_xmit_push_encap
Date: Thu, 26 Feb 2026 10:41:44 +0000 (UTC) [thread overview]
Message-ID: <aab481dc12d67bc2e6fa5981adc5ce250251dd41ec966bd86e227777f18adc0c@mail.kernel.org> (raw)
In-Reply-To: <20260226095156.117996-2-yangfeng59949@163.com>
[-- Attachment #1: Type: text/plain, Size: 1623 bytes --]
> diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
> --- a/net/bpf/test_run.c
> +++ b/net/bpf/test_run.c
> @@ -1156,6 +1156,18 @@
> skb->ip_summed = CHECKSUM_COMPLETE;
> }
>
> + if (prog->type == BPF_PROG_TYPE_LWT_XMIT && !skb_dst(skb)) {
> + if (!ipv6_bpf_stub) {
> + pr_warn_once("Please test this program with the IPv6 module enabled\n");
> + goto out;
Should this set ret to an error code before goto out? At this point
ret is 0 from the earlier convert___skb_to_skb() success path, so the
function returns 0 to the bpf() syscall without ever running the BPF
program.
Every other early exit in bpf_prog_test_run_skb() assigns a negative
errno before goto out, for example:
ret = -EINVAL;
goto out;
ret = -ENOMEM;
goto out;
ret = -ENODEV;
goto out;
Returning 0 here means userspace sees a successful test run that never
actually executed. Something like ret = -EOPNOTSUPP would let the
caller know the test could not proceed.
> + }
> [ ... ]
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/22437468613
AI-authorship-score: low
AI-authorship-explanation: Patch iterated through 7 versions over 3 weeks with detailed maintainer interaction, consistent with human development.
issues-found: 1
issue-severity-score: low
issue-severity-explanation: Missing error return code on early exit path causes bpf() syscall to return success without executing the BPF program when IPv6 is unavailable.
next prev parent reply other threads:[~2026-02-26 10:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-26 9:51 [PATCH v7 bpf-next 0/2] " Feng Yang
2026-02-26 9:51 ` [PATCH v7 bpf-next 1/2] bpf: test_run: " Feng Yang
2026-02-26 10:41 ` bot+bpf-ci [this message]
2026-02-26 9:51 ` [PATCH v7 bpf-next 2/2] selftests/bpf: Add selftests for the invocation of bpf_lwt_xmit_push_encap Feng Yang
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=aab481dc12d67bc2e6fa5981adc5ce250251dd41ec966bd86e227777f18adc0c@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=eddyz87@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=ihor.solodrai@linux.dev \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=posk@google.com \
--cc=yangfeng59949@163.com \
--cc=yonghong.song@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
all inboxes | Powered by JetHome®