[PATCH -mmotm 20/30] netfilter: NF_QUEUE vs emergency skbs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Xiaotian Feng
Date: Tuesday, July 13, 2010 - 3:20 am

From 6c5ccad4c45a73a6d9ebecbfcb1bce8ff3ca462f Mon Sep 17 00:00:00 2001
From: Xiaotian Feng <dfeng@redhat.com>
Date: Tue, 13 Jul 2010 11:38:29 +0800
Subject: [PATCH 20/30] netfilter: NF_QUEUE vs emergency skbs

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 <a.p.zijlstra@chello.nl>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Xiaotian Feng <dfeng@redhat.com>
---
 net/netfilter/core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 78b505d..cc04549 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -176,9 +176,12 @@ next_hook:
 	if (verdict == NF_ACCEPT || verdict == NF_STOP) {
 		ret = 1;
 	} else if (verdict == NF_DROP) {
+drop:
 		kfree_skb(skb);
 		ret = -EPERM;
 	} else if ((verdict & NF_VERDICT_MASK) == NF_QUEUE) {
+		if (skb_emergency(skb))
+			goto drop;
 		if (!nf_queue(skb, elem, pf, hook, indev, outdev, okfn,
 			      verdict >> NF_VERDICT_BITS))
 			goto next_hook;
-- 
1.7.1.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH -mmotm 00/30] [RFC] swap over nfs -v21, Xiaotian Feng, (Tue Jul 13, 3:16 am)
[PATCH -mmotm 02/30] Swap over network documentation, Xiaotian Feng, (Tue Jul 13, 3:17 am)
[PATCH -mmotm 03/30] mm: expose gfp_to_alloc_flags(), Xiaotian Feng, (Tue Jul 13, 3:17 am)
[PATCH -mmotm 04/30] mm: tag reseve pages, Xiaotian Feng, (Tue Jul 13, 3:17 am)
[PATCH -mmotm 06/30] mm: kmem_alloc_estimate(), Xiaotian Feng, (Tue Jul 13, 3:17 am)
[PATCH -mmotm 08/30] mm: emergency pool, Xiaotian Feng, (Tue Jul 13, 3:18 am)
[PATCH -mmotm 09/30] mm: system wide ALLOC_NO_WATERMARK, Xiaotian Feng, (Tue Jul 13, 3:18 am)
[PATCH -mmotm 10/30] mm: __GFP_MEMALLOC, Xiaotian Feng, (Tue Jul 13, 3:18 am)
[PATCH -mmotm 11/30] mm: memory reserve management, Xiaotian Feng, (Tue Jul 13, 3:18 am)
[PATCH -mmotm 13/30] net: packet split receive api, Xiaotian Feng, (Tue Jul 13, 3:19 am)
[PATCH -mmotm 16/30] netvm: INET reserves, Xiaotian Feng, (Tue Jul 13, 3:19 am)
[PATCH -mmotm 18/30] netvm: filter emergency skbs, Xiaotian Feng, (Tue Jul 13, 3:20 am)
[PATCH -mmotm 20/30] netfilter: NF_QUEUE vs emergency skbs, Xiaotian Feng, (Tue Jul 13, 3:20 am)
[PATCH -mmotm 21/30] netvm: skb processing, Xiaotian Feng, (Tue Jul 13, 3:20 am)
[PATCH -mmotm 26/30] nfs: enable swap on NFS, Xiaotian Feng, (Tue Jul 13, 3:21 am)
[PATCH -mmotm 28/30] build fix for skb_emergency_protocol, Xiaotian Feng, (Tue Jul 13, 3:22 am)
Re: [PATCH -mmotm 00/30] [RFC] swap over nfs -v21, Américo Wang, (Tue Jul 13, 5:53 am)