All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: "David S. Miller" <davem@redhat.com>
Cc: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Subject: [PATCH 2.6 4/5]: Fix checks in ip6t_multiport.c
Date: Thu, 14 Oct 2004 02:19:04 +0200	[thread overview]
Message-ID: <416DC5F8.9090009@trash.net> (raw)

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

This patch makes ip6t_multiport check for argument
size and fixes a check against the wrong flags.



[-- Attachment #2: 4.diff --]
[-- Type: text/x-patch, Size: 1746 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/10/14 01:04:09+02:00 yasuyuki.kozakai@toshiba.co.jp 
#   [NETFILTER]: Fix checks in ip6t_multiport.c
#   
#   The first patch fixes following bugs in ip6t_multiport.c,
#   
#     - missing check the size of the preference data.
#     - IP6T_INV_PROTO should check with not ip->flags but ip->invflags.
#   
#   Signed-off-by: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/ipv6/netfilter/ip6t_multiport.c
#   2004/10/14 01:03:43+02:00 yasuyuki.kozakai@toshiba.co.jp +4 -1
#   [NETFILTER]: Fix checks in ip6t_multiport.c
#   
#   The first patch fixes following bugs in ip6t_multiport.c,
#   
#     - missing check the size of the preference data.
#     - IP6T_INV_PROTO should check with not ip->flags but ip->invflags.
#   
#   Signed-off-by: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
diff -Nru a/net/ipv6/netfilter/ip6t_multiport.c b/net/ipv6/netfilter/ip6t_multiport.c
--- a/net/ipv6/netfilter/ip6t_multiport.c	2004-10-14 01:37:19 +02:00
+++ b/net/ipv6/netfilter/ip6t_multiport.c	2004-10-14 01:37:19 +02:00
@@ -87,9 +87,12 @@
 {
 	const struct ip6t_multiport *multiinfo = matchinfo;
 
+	if (matchsize != IP6T_ALIGN(sizeof(struct ip6t_multiport)))
+		return 0;
+
 	/* Must specify proto == TCP/UDP, no unknown flags or bad count */
 	return (ip->proto == IPPROTO_TCP || ip->proto == IPPROTO_UDP)
-		&& !(ip->flags & IP6T_INV_PROTO)
+		&& !(ip->invflags & IP6T_INV_PROTO)
 		&& matchsize == IP6T_ALIGN(sizeof(struct ip6t_multiport))
 		&& (multiinfo->flags == IP6T_MULTIPORT_SOURCE
 		    || multiinfo->flags == IP6T_MULTIPORT_DESTINATION

                 reply	other threads:[~2004-10-14  0:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=416DC5F8.9090009@trash.net \
    --to=kaber@trash.net \
    --cc=davem@redhat.com \
    --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.