All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Zacarias <gustavoz@gentoo.org>
To: sparclinux@vger.kernel.org
Subject: Re: 2.4 kernels and max # of rules with iptables
Date: Mon, 22 Aug 2005 17:17:45 +0000	[thread overview]
Message-ID: <430A08B9.20405@gentoo.org> (raw)
In-Reply-To: <20050619200712.036920e1@enterprise.weeve.org>


[-- Attachment #1.1: Type: text/plain, Size: 331 bytes --]

David S. Miller wrote:

> Looks good to me, I'll pass this along to the netfilter maintainers.

Actually i'm still doing a kmalloc for replsize->counter, that may work,
but since we're cleaning up it should be a vmalloc too (specially since
i'm doing a vfree).
Second time is the charm :)

-- 
Gustavo Zacarias
Gentoo/SPARC monkey

[-- Attachment #1.2: 2.4-netfilter-ioctl32.patch --]
[-- Type: text/x-patch, Size: 1430 bytes --]

diff -Nura linux-2.4.31/arch/sparc64/kernel/sys_sparc32.c linux-2.4.31.netfilter/arch/sparc64/kernel/sys_sparc32.c
--- linux-2.4.31/arch/sparc64/kernel/sys_sparc32.c	2005-04-03 22:42:19.000000000 -0300
+++ linux-2.4.31.netfilter/arch/sparc64/kernel/sys_sparc32.c	2005-08-22 14:14:40.000000000 -0300
@@ -50,6 +50,7 @@
 #include <linux/in.h>
 #include <linux/icmpv6.h>
 #include <linux/sysctl.h>
+#include <linux/vmalloc.h>
 #include <linux/dnotify.h>
 #include <linux/netfilter_ipv4/ip_tables.h>
 
@@ -2919,12 +2920,12 @@
 	if (optlen != kreplsize)
 		return -ENOPROTOOPT;
 
-	krepl = (struct ipt_replace *)kmalloc(kreplsize, GFP_KERNEL);
+	krepl = (struct ipt_replace *)vmalloc(kreplsize);
 	if (krepl == NULL)
 		return -ENOMEM;
 
 	if (copy_from_user(krepl, optval, kreplsize)) {
-		kfree(krepl);
+		vfree(krepl);
 		return -EFAULT;
 	}
 
@@ -2932,10 +2933,9 @@
 		((struct ipt_replace32 *)krepl)->counters);
 
 	kcountersize = krepl->num_counters * sizeof(struct ipt_counters);
-	krepl->counters = (struct ipt_counters *)kmalloc(
-					kcountersize, GFP_KERNEL);
+	krepl->counters = (struct ipt_counters *)vmalloc(kcountersize);
 	if (krepl->counters == NULL) {
-		kfree(krepl);
+		vfree(krepl);
 		return -ENOMEM;
 	}
 
@@ -2949,8 +2949,8 @@
 		copy_to_user(counters32, krepl->counters, kcountersize))
 			ret = -EFAULT;
 
-	kfree(krepl->counters);
-	kfree(krepl);
+	vfree(krepl->counters);
+	vfree(krepl);
 
 	return ret;
 }

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

      parent reply	other threads:[~2005-08-22 17:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-20  2:07 2.4 kernels and max # of rules with iptables Jason Wever
2005-06-20  2:20 ` David S. Miller
2005-06-20  2:27 ` Jason Wever
2005-06-22  2:25 ` Jason Wever
2005-08-17 13:06 ` Josh Grebe
2005-08-17 18:33 ` David S. Miller
2005-08-17 18:53 ` Josh Grebe
2005-08-17 18:57 ` David S. Miller
2005-08-22 17:10 ` Gustavo Zacarias
2005-08-22 17:14 ` David S. Miller
2005-08-22 17:17 ` Gustavo Zacarias [this message]

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=430A08B9.20405@gentoo.org \
    --to=gustavoz@gentoo.org \
    --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.