mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 01:54:09 +08:00
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: Eric Dumazet <edumazet@google.com> Signed-off-by: Roman Gushchin <klamm@yandex-team.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
aa9c557915
commit
93a35f59f1
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user