All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netfilter-devel@lists.netfilter.org, Patrick McHardy <kaber@trash.net>
Subject: [NETFILTER 01/06]: nf_queue: handle NF_STOP and unknown verdicts in nf_reinject
Date: Tue, 25 Jul 2006 05:26:55 +0200 (MEST)	[thread overview]
Message-ID: <20060725032655.25063.6835.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20060725032653.25063.8139.sendpatchset@localhost.localdomain>

[NETFILTER]: nf_queue: handle NF_STOP and unknown verdicts in nf_reinject

In case of an unknown verdict or NF_STOP the packet leaks. Unknown verdicts
can happen when userspace is buggy. Reinject the packet in case of NF_STOP,
drop on unknown verdicts.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 559fa54b6c0d2813de1d4753964587fc3655bbf1
tree b160176d29bdf8ff93cf6491533e41104fa19f93
parent 440848a8e33fc1927bab45bd73f6c8e042ea7abd
author Patrick McHardy <kaber@trash.net> Tue, 25 Jul 2006 00:02:11 +0200
committer Patrick McHardy <kaber@trash.net> Tue, 25 Jul 2006 00:02:11 +0200

 net/netfilter/nf_queue.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index bb6fcee..662a869 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -219,21 +219,20 @@ #endif
 
 	switch (verdict & NF_VERDICT_MASK) {
 	case NF_ACCEPT:
+	case NF_STOP:
 		info->okfn(skb);
+	case NF_STOLEN:
 		break;
-
 	case NF_QUEUE:
 		if (!nf_queue(&skb, elem, info->pf, info->hook, 
 			      info->indev, info->outdev, info->okfn,
 			      verdict >> NF_VERDICT_BITS))
 			goto next_hook;
 		break;
+	default:
+		kfree_skb(skb);
 	}
 	rcu_read_unlock();
-
-	if (verdict == NF_DROP)
-		kfree_skb(skb);
-
 	kfree(info);
 	return;
 }

  reply	other threads:[~2006-07-25  3:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-25  3:26 [NETFILTER 00/06]: Netfilter fixes Patrick McHardy
2006-07-25  3:26 ` Patrick McHardy [this message]
2006-07-25  3:26 ` [NETFILTER 02/06]: conntrack: fix SYSCTL=n compile Patrick McHardy
2006-07-25  3:26 ` [NETFILTER 03/06]: SNMP NAT: fix byteorder confusion Patrick McHardy
2006-07-25  3:26 ` [NETFILTER 04/06]: xt_pkttype: fix mismatches on locally generated packets Patrick McHardy
2006-07-25  3:27 ` [NETFILTER 05/06]: bridge netfilter: add deferred output hooks to feature-removal-schedule Patrick McHardy
2006-07-25  3:27 ` [NETFILTER 06/06]: Demote xt_sctp to EXPERIMENTAL Patrick McHardy
2006-07-25  5:55 ` [NETFILTER 00/06]: Netfilter fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060725032655.25063.6835.sendpatchset@localhost.localdomain \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.