[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57de8ffd-e832-27b8-dede-f9ef76306470@gmail.com>
Date: Tue, 18 Sep 2018 11:07:10 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Petar Penkov <peterpenkov96@...il.com>, netdev@...r.kernel.org
Cc: davem@...emloft.net, ast@...nel.org, daniel@...earbox.net,
simon.horman@...ronome.com, ecree@...arflare.com,
songliubraving@...com, tom@...bertland.com,
Petar Penkov <ppenkov@...gle.com>,
Willem de Bruijn <willemb@...gle.com>
Subject: Re: [bpf-next, v4 1/5] flow_dissector: implements flow dissector BPF
hook
On 09/14/2018 07:46 AM, Petar Penkov wrote:
> From: Petar Penkov <ppenkov@...gle.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.
(AF_UNIX generates skbs)
> + if (attached) {
> + /* Note that even though the const qualifier is discarded
> + * throughout the execution of the BPF program, all changes(the
> + * control block) are reverted after the BPF program returns.
> + * Therefore, __skb_flow_dissect does not alter the skb.
> + */
Powered by blists - more mailing lists