All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: syzbot+af9492708df9797198d6@syzkaller.appspotmail.com,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Andrii Nakryiko <andrii@kernel.org>,
	Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
	Yonghong Song <yonghong.song@linux.dev>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@kernel.org>,
	Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
	Jiri Olsa <jolsa@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Hangbin Liu <liuhangbin@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	bpf@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH bpf] xdp: use flags field to disambiguate broadcast redirect
Date: Mon, 22 Apr 2024 11:21:18 -0700	[thread overview]
Message-ID: <ce9252ef-21e2-4b09-9797-590f5eaa2869@linux.dev> (raw)
In-Reply-To: <878r18tjr2.fsf@toke.dk>

On 4/20/24 3:24 AM, Toke Høiland-Jørgensen wrote:
>>   From reading the "waits for...NAPI being the relevant context here..." comment
>> in dev_map_free(), I wonder if moving synchronize_rcu() before
>> bpf_clear_redirect_map() would also work? Actually, does it need to call
>> bpf_clear_redirect_map(). The on-going xdp_do_redirect() should be the last one
>> using the map in ri->map anyway and no xdp prog can set it again to
>>   ri->map.
> I think we do need to retain the current behaviour, because of the
> decoupling between the helper and the return code. Otherwise, you could

Forgot there could be a disconnect here.

Applied. Thanks.

> have a program that calls the bpf_redirect_map() helper, but returns a
> different value (say, XDP_DROP). In this case, the map pointer will
> stick around in struct bpf_redirect_info, and if a subsequent XDP
> program then returns XDP_REDIRECT (*without*  calling
> bpf_redirect_map()), it will use the stale pointer value and cause a


  reply	other threads:[~2024-04-22 18:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18  7:18 [PATCH bpf] xdp: use flags field to disambiguate broadcast redirect Toke Høiland-Jørgensen
2024-04-18 18:19 ` Stanislav Fomichev
2024-04-18 18:31   ` Toke Høiland-Jørgensen
2024-04-18 20:38     ` Stanislav Fomichev
2024-04-19  1:37 ` Hangbin Liu
2024-04-19 14:35 ` Jesper Dangaard Brouer
2024-04-20  2:00 ` Martin KaFai Lau
2024-04-20 10:24   ` Toke Høiland-Jørgensen
2024-04-22 18:21     ` Martin KaFai Lau [this message]
2024-04-22 17:50 ` patchwork-bot+netdevbpf

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=ce9252ef-21e2-4b09-9797-590f5eaa2869@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=haoluo@google.com \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=kuba@kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=syzbot+af9492708df9797198d6@syzkaller.appspotmail.com \
    --cc=toke@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.