From: Martin KaFai Lau <martin.lau@linux.dev>
To: Michal Switala <michal.switala@infogain.com>
Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, revest@google.com,
syzbot+cca39e6e84a367a7e6f6@syzkaller.appspotmail.com,
alexei.starovoitov@gmail.com,
"Toke Høiland-Jørgensen" <toke@redhat.com>
Subject: Re: [PATCH] bpf: Ensure BPF programs testing skb context initialization
Date: Mon, 15 Jul 2024 14:59:54 -0700 [thread overview]
Message-ID: <250854fc-ce22-4866-95f9-d61f6653af64@linux.dev> (raw)
In-Reply-To: <20240715181339.2489649-1-michal.switala@infogain.com>
On 7/15/24 11:13 AM, Michal Switala wrote:
>> Reported-by: syzbot+cca39e6e84a367a7e6f6@syzkaller.appspotmail.com
>> Closes: https://syzkaller.appspot.com/bug?extid=cca39e6e84a367a7e6f6
>> Link: https://lore.kernel.org/all/000000000000b95d41061cbf302a@google.com/
>
> Something doesn't add up.
> This syzbot report is about:
>
> dev_map_enqueue+0x31/0x3e0 kernel/bpf/devmap.c:539
> __xdp_do_redirect_frame net/core/filter.c:4397 [inline]
> bpf_prog_test_run_xdp
>
> why you're fixing bpf_prog_test_run_skb ?
[ Please keep the relevant email context in the reply ]
> The reproducer calls the methods bpf_prog_test_run_xdp and
> bpf_prog_test_run_skb. Both lead to the invocation of dev_map_enqueue, in the
The syzbot report is triggering from the bpf_prog_test_run_xdp. I agree with
Alexei that fixing the bpf_prog_test_run_skb does not make sense. At least I
don't see how dev_map_enqueue can be used from bpf_prog_test_run_skb.
It looks very similar to
https://lore.kernel.org/bpf/000000000000f6531b061494e696@google.com/. It has
been fixed in commit 5bcf0dcbf906 ("xdp: use flags field to disambiguate
broadcast redirect")
I tried the C repro. I can reproduce in the bpf tree also which should have the
fix. I cannot reproduce in the bpf-next though.
Cc Toke who knows more details here.
> case of the former, the backtrace is recorded in its entirety, whereas for the
> latter it is not. I think the bug might be incorrectly reported on syzkaller, as
> during GDB debugging, the problem occurred in functions called from
> bpf_prog_test_run_skb. I also ran testing of my patch on syzkaller and the tests
> passed.
next prev parent reply other threads:[~2024-07-15 22:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 8:46 [PATCH] bpf: Ensure BPF programs testing skb context initialization Michal Switala
2024-07-10 18:38 ` Alexei Starovoitov
2024-07-15 18:13 ` Michal Switala
2024-07-15 21:59 ` Martin KaFai Lau [this message]
2024-07-17 13:28 ` Toke Høiland-Jørgensen
2024-07-17 19:16 ` Martin KaFai Lau
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=250854fc-ce22-4866-95f9-d61f6653af64@linux.dev \
--to=martin.lau@linux.dev \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.switala@infogain.com \
--cc=netdev@vger.kernel.org \
--cc=revest@google.com \
--cc=syzbot+cca39e6e84a367a7e6f6@syzkaller.appspotmail.com \
--cc=toke@redhat.com \
/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