Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93a35f59 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

net: napi_reuse_skb() should check pfmemalloc



Do not reuse skb if it was pfmemalloc tainted, otherwise
future frame might be dropped anyway.

Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarRoman Gushchin <klamm@yandex-team.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aa9c5579
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4157,6 +4157,10 @@ EXPORT_SYMBOL(napi_gro_receive);

static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
{
	if (unlikely(skb->pfmemalloc)) {
		consume_skb(skb);
		return;
	}
	__skb_pull(skb, skb_headlen(skb));
	/* restore the reserve we had after netdev_alloc_skb_ip_align() */
	skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb));