All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@davemloft.net>,
	Netfilter Development Mailinglist
	<netfilter-devel@vger.kernel.org>
Subject: netfilter: ip6t_{hbh,dst}: Rejects not-strict mode on rule insertion
Date: Wed, 24 Sep 2008 18:07:23 +0200	[thread overview]
Message-ID: <48DA65BB.6080605@trash.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

Hi Dave,

the following netfilter patch is intended for 2.6.27. According to
Yasuyuki, it fixes a potential security problem that is currently
not an issue because userspace is sufficiently broken so the feature
can't be used, but once we fix userspace it might be used on old
kernels and the problem will be an issue. So I agree with Yasuyuki
that this should go in 2.6.27 (and -stable afterwards).

Please apply, thanks.


[-- Attachment #2: x --]
[-- Type: text/plain, Size: 1473 bytes --]

commit dbc35b57f311d95d3480f006805e2284f083dbcf
Author: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Date:   Wed Sep 24 17:29:30 2008 +0200

    netfilter: ip6t_{hbh,dst}: Rejects not-strict mode on rule insertion
    
    The current code ignores rules for internal options in HBH/DST options
    header in packet processing if 'Not strict' mode is specified (which is not
    implemented). Clearly it is not expected by user.
    
    Kernel should reject HBH/DST rule insertion with 'Not strict' mode
    in the first place.
    
    Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/net/ipv6/netfilter/ip6t_hbh.c b/net/ipv6/netfilter/ip6t_hbh.c
index 62e39ac..26654b2 100644
--- a/net/ipv6/netfilter/ip6t_hbh.c
+++ b/net/ipv6/netfilter/ip6t_hbh.c
@@ -97,8 +97,6 @@ hbh_mt6(const struct sk_buff *skb, const struct net_device *in,
 	hdrlen -= 2;
 	if (!(optinfo->flags & IP6T_OPTS_OPTS)) {
 		return ret;
-	} else if (optinfo->flags & IP6T_OPTS_NSTRICT) {
-		pr_debug("Not strict - not implemented");
 	} else {
 		pr_debug("Strict ");
 		pr_debug("#%d ", optinfo->optsnr);
@@ -177,6 +175,12 @@ hbh_mt6_check(const char *tablename, const void *entry,
 		pr_debug("ip6t_opts: unknown flags %X\n", optsinfo->invflags);
 		return false;
 	}
+
+	if (optsinfo->flags & IP6T_OPTS_NSTRICT) {
+		pr_debug("ip6t_opts: Not strict - not implemented");
+		return false;
+	}
+
 	return true;
 }
 

             reply	other threads:[~2008-09-24 16:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-24 16:07 Patrick McHardy [this message]
2008-09-24 22:53 ` netfilter: ip6t_{hbh,dst}: Rejects not-strict mode on rule insertion 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=48DA65BB.6080605@trash.net \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netfilter-devel@vger.kernel.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.