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 21/22]: ip6t_mh: drop piggyback payload packet on MH packets
Date: Mon, 12 Feb 2007 11:36:51 +0100 (MET)	[thread overview]
Message-ID: <20070212103651.661.8735.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20070212103621.661.65165.sendpatchset@localhost.localdomain>

[NETFILTER]: ip6t_mh: drop piggyback payload packet on MH packets

Regarding RFC3775, MH payload proto field should be IPPROTO_NONE. Otherwise
it must be discarded (and the receiver should send ICMP error).

We assume filter should drop such piggyback everytime to disallow slipping
through firewall rules, even the final receiver will discard it.

Signed-off-by: Masahide NAKAMURA <nakam@linux-ipv6.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit a7b4ff1031d3e62fad2b7da2068bb5deb2041325
tree ba6d4b4517999ebf0876a5618640276a6a251503
parent 353c941b0735b883510bfd7bb98fcd4fc8a0ee08
author Masahide NAKAMURA <nakam@linux-ipv6.org> Mon, 12 Feb 2007 11:08:11 +0100
committer Patrick McHardy <kaber@trash.net> Mon, 12 Feb 2007 11:08:11 +0100

 net/ipv6/netfilter/ip6t_mh.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/ipv6/netfilter/ip6t_mh.c b/net/ipv6/netfilter/ip6t_mh.c
index 2c7efc6..c2a9098 100644
--- a/net/ipv6/netfilter/ip6t_mh.c
+++ b/net/ipv6/netfilter/ip6t_mh.c
@@ -66,6 +66,13 @@ match(const struct sk_buff *skb,
 		return 0;
 	}
 
+	if (mh->ip6mh_proto != IPPROTO_NONE) {
+		duprintf("Dropping invalid MH Payload Proto: %u\n",
+			 mh->ip6mh_proto);
+		*hotdrop = 1;
+		return 0;
+	}
+
 	return type_match(mhinfo->types[0], mhinfo->types[1], mh->ip6mh_type,
 			  !!(mhinfo->invflags & IP6T_MH_INV_TYPE));
 }

  parent reply	other threads:[~2007-02-12 10:36 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12 10:36 [NETFILTER 00/22]: Netfilter update/fixes Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 01/22]: Properly use RCU in nf_ct_attach Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 02/22]: Remove unnecessary synchronize_net() in nf_register_hook Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 03/22]: Switch nf_register_afinfo/nf_unregister_afinfo to mutex Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 04/22]: Switch nf_register_hook/nf_unregister_hook " Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 05/22]: nf_log: use rcu_assign_pointer for RCU protected pointer Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 06/22]: nf_log: make nf_log_unregister_pf return void Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 07/22]: nf_log: switch logger registration/unregistration to mutex Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 08/22]: nf_log: minor cleanups Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 09/22]: ip_nat: properly use RCU API for ip_nat_protos array Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 10/22]: nf_nat: properly use RCU API for nf_nat_protos array Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 11/22]: ip_conntrack: properly use RCU API for ip_ct_protos array Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 12/22]: nf_conntrack: properly use RCU API for nf_ct_protos/nf_ct_l3protos arrays Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 13/22]: ip_conntrack: fix invalid conntrack statistics RCU assumption Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 14/22]: nf_conntrack: " Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 15/22]: ip_conntrack: properly use RCU for ip_conntrack_destroyed callback Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 16/22]: nf_conntrack: properly use RCU for nf_conntrack_destroyed callback Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 17/22]: nf_conntrack: change nf_conntrack_l[34]proto_unregister to void Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 18/22]: xt_mac/xt_CLASSIFY: use IPv6 hook names for IPv6 registration Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 19/22]: Kconfig: improve dependency handling Patrick McHardy
2007-02-12 10:36 ` [NETFILTER 20/22]: Fix whitespace errors Patrick McHardy
2007-02-12 10:36 ` Patrick McHardy [this message]
2007-02-12 10:36 ` [NETFILTER 22/22]: nf_conntrack_tcp: make sysctl variables static Patrick McHardy
2007-02-12 19:17 ` [NETFILTER 00/22]: Netfilter update/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=20070212103651.661.8735.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.