mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Alban Crequy <alban@kinvolk.io>
Cc: "Alban Crequy" <alban.crequy@gmail.com>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	bpf <bpf@vger.kernel.org>, netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Iago López Galeiras" <iago@kinvolk.io>
Subject: Re: [PATCH bpf-next v3 1/4] bpf: sock ops: add netns ino and dev in bpf context
Date: Sat, 27 Apr 2019 11:39:40 -0700	[thread overview]
Message-ID: <20190427113940.223fd4d1@cakuba.netronome.com> (raw)
In-Reply-To: <CADZs7q7O9TL5wXFBq_SgAdNCkzO=3tyLnF1_chthX3jao=PKqA@mail.gmail.com>

On Sat, 27 Apr 2019 12:48:25 +0200, Alban Crequy wrote:
> On Fri, Apr 26, 2019 at 11:03 PM Jakub Kicinski
> <jakub.kicinski@netronome.com> wrote:
> >
> > On Fri, 26 Apr 2019 17:48:45 +0200, Alban Crequy wrote:  
> > > In the unlikely case where network namespaces are not compiled in
> > > (CONFIG_NET_NS=n), the verifier will not allow access to ->netns_*.  
> >
> > Naive question - why return an error?  init_net should always be there,
> > no?  
> 
> True for netns_dev. However, without CONFIG_NET_NS, we cannot access netns_ino:
> 
> (struct sock_common).possible_net_t.(struct net *):
> 
> typedef struct {
> #ifdef CONFIG_NET_NS
>         struct net *net;
> #endif
> } possible_net_t;
> 
> And I don't think it would make much sense to allow access to
> netns_dev but not netns_ino.

Right, if CONFIG_NET_NS=n we could just take the pointer to init_net
directly, and not worry about the field.  IMHO it'd be preferable to
changing the UAPI based on kernel config, but I don't feel super
strongly.

  reply	other threads:[~2019-04-27 18:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26 15:48 Alban Crequy
2019-04-26 15:48 ` [PATCH bpf-next v3 2/4] bpf: sync bpf.h to tools/ for bpf_sock_ops->netns* Alban Crequy
2019-04-26 15:48 ` [PATCH bpf-next v3 3/4] selftests: bpf: read netns_ino from struct bpf_sock_ops Alban Crequy
2019-04-26 15:48 ` [PATCH bpf-next v3 4/4] selftests: bpf: verifier: read netns_dev and " Alban Crequy
2019-04-26 21:03 ` [PATCH bpf-next v3 1/4] bpf: sock ops: add netns ino and dev in bpf context Jakub Kicinski
2019-04-27 10:48   ` Alban Crequy
2019-04-27 18:39     ` Jakub Kicinski [this message]
2019-04-29 15:42       ` Alban Crequy
2019-04-27 16:34 ` Y Song
2019-04-29 15:34   ` Alban Crequy

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=20190427113940.223fd4d1@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=alban.crequy@gmail.com \
    --cc=alban@kinvolk.io \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=iago@kinvolk.io \
    --cc=john.fastabend@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.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

all inboxes | Powered by JetHome®