summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2017-12-14 17:17:56 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2017-12-15 14:34:36 +0100
commit2d17d8d79e77ff3f1b35b87522fc72fa562260ff (patch)
treed21c62dc68e76e58c452fd2a04a6a0883227742e /net
parent8c8f67a46f2bf33556ad12a1971734047b60831a (diff)
downloadlinux-2d17d8d79e77ff3f1b35b87522fc72fa562260ff.tar.gz
linux-2d17d8d79e77ff3f1b35b87522fc72fa562260ff.tar.bz2
linux-2d17d8d79e77ff3f1b35b87522fc72fa562260ff.zip
xdp: linearize skb in netif_receive_generic_xdp()
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>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index f47e96b62308..01ee854454a8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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;
}