Skip to content

Commit 2d17d8d

Browse files
liu-song-6borkmann
authored andcommitted
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: de8f3a8 ("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>
1 parent 8c8f67a commit 2d17d8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/core/dev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3904,7 +3904,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
39043904
hroom > 0 ? ALIGN(hroom, NET_SKB_PAD) : 0,
39053905
troom > 0 ? troom + 128 : 0, GFP_ATOMIC))
39063906
goto do_drop;
3907-
if (troom > 0 && __skb_linearize(skb))
3907+
if (skb_linearize(skb))
39083908
goto do_drop;
39093909
}
39103910

0 commit comments

Comments
 (0)