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.

(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.
> +              */


Reply via email to