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

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
...@@ -4157,6 +4157,10 @@ EXPORT_SYMBOL(napi_gro_receive); ...@@ -4157,6 +4157,10 @@ EXPORT_SYMBOL(napi_gro_receive);
static void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb) 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)); __skb_pull(skb, skb_headlen(skb));
/* restore the reserve we had after netdev_alloc_skb_ip_align() */ /* restore the reserve we had after netdev_alloc_skb_ip_align() */
skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb)); skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN - skb_headroom(skb));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment