On Tue, Sep 18, 2018 at 2:09 PM Eric Dumazet <eric.duma...@gmail.com> wrote:
>
>
>
> On 09/14/2018 07:46 AM, Petar Penkov wrote:
> > From: Petar Penkov <ppen...@google.com>
> >
> > Adds a hook for programs of type BPF_PROG_TYPE_FLOW_DISSECTOR and
> > attach type BPF_FLOW_DISSECTOR that is executed in the flow dissector
> > path. The BPF program is per-network namespace
>
> ...
>
> >
> > +     rcu_read_lock();
> > +     attached = skb ? 
> > rcu_dereference(dev_net(skb->dev)->flow_dissector_prog)
> > +                    : NULL;
>
>
> Some skbs have a NULL skb->dev, so we are going to crash here.

Ai. Thanks, Eric.

For these cases, we can probably infer the netns from sk->sk_net. That
is assuming that all skbs have at least one of skb->sk or skb->dev
set.

Reply via email to