All of lore.kernel.org
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@redhat.com>
To: Georg Chini <georg.chini@triaton-webhosting.com>
Cc: rezso@rdsor.ro, sparclinux@vger.kernel.org,
	netfilter-devel@lists.netfilter.org
Subject: Re: iptables+2.6-test8-bk4 : Still problems
Date: Tue, 28 Oct 2003 23:13:17 -0800	[thread overview]
Message-ID: <20031028231317.7840e47f.davem@redhat.com> (raw)
In-Reply-To: <3F9ED206.4040806@triaton-webhosting.com>


Ok, here is the patch I'm using to fix this, please test.

Thanks again for figuring out the problem Georg.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1380  -> 1.1381 
#	        net/compat.c	1.11    -> 1.12   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/10/28	davem@nuts.ninka.net	1.1381
# [NET/COMPAT]: Fix copying of ipt_entry objects in do_netfilter_replace().
# 
# As noted by Georg Chini, ipt_entry object are of variable size
# so just copying individual struct ipt_entry slots around does
# not work.
# --------------------------------------------
#
diff -Nru a/net/compat.c b/net/compat.c
--- a/net/compat.c	Tue Oct 28 23:16:40 2003
+++ b/net/compat.c	Tue Oct 28 23:16:40 2003
@@ -322,7 +322,7 @@
 	u32 origsize, tmp32, num_counters;
 	unsigned int repl_nat_size;
 	int ret;
-	int i, num_ents;
+	int i;
 	compat_uptr_t ucntrs;
 
 	if (get_user(origsize, &urepl->size))
@@ -366,15 +366,10 @@
 	    __put_user(compat_ptr(ucntrs), &repl_nat->counters))
 		goto out;
 
-	num_ents = origsize / sizeof(struct ipt_entry);
-
-	for (i = 0; i < num_ents; i++) {
-		struct ipt_entry ent;
-
-		if (__copy_from_user(&ent, &urepl->entries[i], sizeof(ent)) ||
-		    __copy_to_user(&repl_nat->entries[i], &ent, sizeof(ent)))
-			goto out;
-	}
+	if (__copy_in_user(&repl_nat->entries[0],
+			   &urepl->entries[0],
+			   origsize))
+		goto out;
 
 	for (i = 0; i < NF_IP_NUMHOOKS; i++) {
 		if (__get_user(tmp32, &urepl->hook_entry[i]) ||

  parent reply	other threads:[~2003-10-29  7:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-26  8:48 iptables+2.6-test8-bk4 : Still problems Georg Chini
2003-10-26 15:52 ` Balint Cristian
2003-10-27  6:34   ` David S. Miller
2003-10-28 20:31     ` Georg Chini
2003-10-29  6:48       ` David S. Miller
2003-10-29  7:13       ` David S. Miller [this message]
2003-10-29 18:20         ` Ryan Veety
2003-10-29 18:34           ` David S. 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=20031028231317.7840e47f.davem@redhat.com \
    --to=davem@redhat.com \
    --cc=georg.chini@triaton-webhosting.com \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=rezso@rdsor.ro \
    --cc=sparclinux@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.