]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
xdp: linearize skb in netif_receive_generic_xdp()
authorSong Liu <songliubraving@fb.com>
Fri, 15 Dec 2017 01:17:56 +0000 (17:17 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 15 Dec 2017 13:34:36 +0000 (14:34 +0100)
In netif_receive_generic_xdp(), it is necessary to linearize all
nonlinear skb. However, in current implementation, skb with
troom <= 0 are not linearized. This patch fixes this by calling
skb_linearize() for all nonlinear skb.

Fixes: de8f3a83b0a0 ("bpf: add meta pointer for direct access")
Signed-off-by: Song Liu <songliubraving@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/dev.c

index f47e96b623088ae354947787ef17217cd32ae64e..01ee854454a8089cdd49e2c8964a99f6a2d74730 100644 (file)
@@ -3904,7 +3904,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
                                     hroom > 0 ? ALIGN(hroom, NET_SKB_PAD) : 0,
                                     troom > 0 ? troom + 128 : 0, GFP_ATOMIC))
                        goto do_drop;
-               if (troom > 0 && __skb_linearize(skb))
+               if (skb_linearize(skb))
                        goto do_drop;
        }