netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	bpf@vger.kernel.org, netdev@vger.kernel.org,
	martin.lau@linux.dev, razor@blackwall.org, ast@kernel.org,
	andrii@kernel.org, john.fastabend@gmail.com, sdf@google.com,
	toke@kernel.org
Subject: Re: [PATCH bpf-next v2 1/7] netkit, bpf: Add bpf programmable net device
Date: Fri, 20 Oct 2023 18:43:48 -0700	[thread overview]
Message-ID: <20231020184348.528aa62c@kernel.org> (raw)
In-Reply-To: <33467f55-4bbf-4078-af21-d91c6aab82ee@lunn.ch>

On Sat, 21 Oct 2023 00:18:53 +0200 Andrew Lunn wrote:
> > +	err = rtnl_configure_link(peer, ifmp, 0, NULL);
> > +	if (err < 0)
> > +		goto err_configure_peer;  
> 
> Seeing code after calling register_netdevice() often means bugs. The
> interface is live, and in use before the function even returns. The
> kernel can try to get an IP address, mount an NFS root etc. This might
> be safe, because you have two linked interfaces here, and the other
> one is not yet registered. Maybe some comment about this would be
> good, or can the rtnl_configure_link() be done earlier?

These are in the newlink callback, rtnl is held throughout.
Which is not to say that corresponding code in veth wasn't 
a source of many bugs :S

  parent reply	other threads:[~2023-10-21  1:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-19 20:49 [PATCH bpf-next v2 0/7] Add bpf programmable net device Daniel Borkmann
2023-10-19 20:49 ` [PATCH bpf-next v2 1/7] netkit, bpf: " Daniel Borkmann
2023-10-20 22:18   ` Andrew Lunn
2023-10-20 22:38     ` Daniel Borkmann
2023-10-21  1:43     ` Jakub Kicinski [this message]
2023-10-21  1:41   ` Jakub Kicinski
2023-10-19 20:49 ` [PATCH bpf-next v2 2/7] tools: Sync if_link uapi header Daniel Borkmann
2023-10-19 20:49 ` [PATCH bpf-next v2 3/7] libbpf: Add link-based API for netkit Daniel Borkmann
2023-10-19 20:49 ` [PATCH bpf-next v2 4/7] bpftool: Implement link show support " Daniel Borkmann
2023-10-23 14:26   ` Toke Høiland-Jørgensen
2023-10-23 14:46     ` Daniel Borkmann
2023-10-19 20:49 ` [PATCH bpf-next v2 5/7] bpftool: Extend net dump with netkit progs Daniel Borkmann
2023-10-19 20:49 ` [PATCH bpf-next v2 6/7] selftests/bpf: Add netlink helper library Daniel Borkmann
2023-10-19 20:49 ` [PATCH bpf-next v2 7/7] selftests/bpf: Add selftests for netkit Daniel Borkmann

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=20231020184348.528aa62c@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=martin.lau@linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=razor@blackwall.org \
    --cc=sdf@google.com \
    --cc=toke@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).