[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1414071030.2094.46.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 23 Oct 2014 06:30:30 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Roman Gushchin <klamm@...dex-team.ru>
Cc: "jeffrey.t.kirsher@...el.com" <jeffrey.t.kirsher@...el.com>,
"jesse.brandeburg@...el.com" <jesse.brandeburg@...el.com>,
"bruce.w.allan@...el.com" <bruce.w.allan@...el.com>,
"carolyn.wyborny@...el.com" <carolyn.wyborny@...el.com>,
"donald.c.skidmore@...el.com" <donald.c.skidmore@...el.com>,
"gregory.v.rose@...el.com" <gregory.v.rose@...el.com>,
"peter.p.waskiewicz.jr@...el.com" <peter.p.waskiewicz.jr@...el.com>,
"alexander.h.duyck@...el.com" <alexander.h.duyck@...el.com>,
"john.ronciak@...el.com" <john.ronciak@...el.com>,
"tushar.n.dave@...el.com" <tushar.n.dave@...el.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"sassmann@...nic.de" <sassmann@...nic.de>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"e1000-devel@...ts.sourceforge.net"
<e1000-devel@...ts.sourceforge.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATHC] net: napi_reuse_skb() should check pfmemalloc
From: Eric Dumazet <edumazet@...gle.com>
Do not reuse skb if it was pfmemalloc tainted, otherwise
future frame might be dropped anyway.
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
net/core/dev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index b793e3521a36..945bbd001359 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists