All of lore.kernel.org
 help / color / mirror / Atom feed
From: Phil Oester <kernel@linuxace.com>
To: netfilter-devel@lists.netfilter.org
Subject: [PATCH] iptables segfault on -D
Date: Thu, 3 Feb 2005 16:55:37 -0800	[thread overview]
Message-ID: <20050204005537.GA25682@linuxace.com> (raw)

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

Using latest 1.3.0-rc1 snapshot, a rule delete causes a segfault:

# iptables -A foo -p tcp --dport 1234   
# iptables -D foo -p tcp --dport 1234
Segmentation fault

Problem is caused by a superfluous memset which memsets a greater-
than-malloced area.  Patch below.

Phil



[-- Attachment #2: patch-sigsegv --]
[-- Type: text/plain, Size: 417 bytes --]

--- ipt-orig/libiptc/libiptc.c	2005-02-01 08:45:56.000000000 -0800
+++ ipt-new/libiptc/libiptc.c	2005-02-03 16:51:46.000000000 -0800
@@ -2047,7 +2047,6 @@
 
 	counterlen = sizeof(STRUCT_COUNTERS_INFO)
 			+ sizeof(STRUCT_COUNTERS) * new_number;
-	memset(repl, 0, sizeof(*repl) + (*handle)->entries->size);
 
 	/* These are the old counters we will get from kernel */
 	repl->counters = malloc(sizeof(STRUCT_COUNTERS)

             reply	other threads:[~2005-02-04  0:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-04  0:55 Phil Oester [this message]
2005-02-04  7:36 ` [PATCH] iptables segfault on -D Martin Josefsson

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=20050204005537.GA25682@linuxace.com \
    --to=kernel@linuxace.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.