From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <20080320202124.669487000@chello.nl> References: <20080320201042.675090000@chello.nl> Date: Thu, 20 Mar 2008 21:11:04 +0100 From: Peter Zijlstra Subject: [PATCH 22/30] netfilter: NF_QUEUE vs emergency skbs Content-Disposition: inline; filename=emergency-nf_queue.patch Sender: owner-linux-mm@kvack.org Return-Path: To: Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, trond.myklebust@fys.uio.no, neilb@suse.de, miklos@szeredi.hu, penberg@cs.helsinki.fi, a.p.zijlstra@chello.nl List-ID: Avoid memory getting stuck waiting for userspace, drop all emergency packets. This of course requires the regular storage route to not include an NF_QUEUE target ;-) Signed-off-by: Peter Zijlstra --- net/netfilter/core.c | 3 +++ 1 file changed, 3 insertions(+) Index: linux-2.6/net/netfilter/core.c =================================================================== --- linux-2.6.orig/net/netfilter/core.c +++ linux-2.6/net/netfilter/core.c @@ -176,9 +176,12 @@ next_hook: ret = 1; goto unlock; } else if (verdict == NF_DROP) { +drop: kfree_skb(skb); ret = -EPERM; } else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) { + if (skb_emergency(*pskb)) + goto drop; if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn, verdict >> NF_VERDICT_BITS)) goto next_hook; -- -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org