netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: David Miller <davem@davemloft.net>
Cc: chris@ex-parrot.com, akpm@osdl.org, netdev@vger.kernel.org
Subject: Re: crash in ipt_do_table
Date: Fri, 18 Aug 2006 07:45:59 +0200	[thread overview]
Message-ID: <44E55417.2000508@trash.net> (raw)
In-Reply-To: <20060817.181403.78708132.davem@davemloft.net>

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

David Miller wrote:
> From: Patrick McHardy <kaber@trash.net>
> Date: Tue, 15 Aug 2006 16:01:06 +0200
> 
> 
>>Any chance you're also changing your ruleset dynamically? If yes
>>this patch might help.
> 
> 
> I've applied this.

Thanks, but it seems you applied the first patch I sent, which was
missing the same fix for arp_tables. This patch contains the missing
bits.

I'm going to send the (combined) patch to -stable as well, this bug
seems to have hit quite a few people.


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

[NETFILTER]: arp_tables: fix table locking in arpt_do_table

table->private might change because of ruleset changes, don't use it without
holding the lock.

Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 338fe5c67e8fb799c9e3470331db6f3c60a31b1e
tree 2dc15d63244ed18a8035ae483ae2d722e7fbcf62
parent 32ce9bc41528c327b1353713b2108d2213128dee
author Patrick McHardy <kaber@trash.net> Tue, 15 Aug 2006 16:06:57 +0200
committer Patrick McHardy <kaber@trash.net> Tue, 15 Aug 2006 16:06:57 +0200

 net/ipv4/netfilter/arp_tables.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
index df4854c..8d1d7a6 100644
--- a/net/ipv4/netfilter/arp_tables.c
+++ b/net/ipv4/netfilter/arp_tables.c
@@ -236,7 +236,7 @@ unsigned int arpt_do_table(struct sk_buf
 	struct arpt_entry *e, *back;
 	const char *indev, *outdev;
 	void *table_base;
-	struct xt_table_info *private = table->private;
+	struct xt_table_info *private;
 
 	/* ARP header, plus 2 device addresses, plus 2 IP addresses.  */
 	if (!pskb_may_pull((*pskb), (sizeof(struct arphdr) +
@@ -248,6 +248,7 @@ unsigned int arpt_do_table(struct sk_buf
 	outdev = out ? out->name : nulldevname;
 
 	read_lock_bh(&table->lock);
+	private = table->private;
 	table_base = (void *)private->entries[smp_processor_id()];
 	e = get_entry(table_base, private->hook_entry[hook]);
 	back = get_entry(table_base, private->underflow[hook]);

  reply	other threads:[~2006-08-18  5:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-15  7:54 Fw: crash in ipt_do_table Andrew Morton
2006-08-15 14:01 ` Patrick McHardy
2006-08-15 14:06   ` Patrick McHardy
2006-08-15 14:29   ` Chris Lightfoot
2006-08-18  1:14   ` David Miller
2006-08-18  5:45     ` Patrick McHardy [this message]
2006-08-18  5:58       ` 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=44E55417.2000508@trash.net \
    --to=kaber@trash.net \
    --cc=akpm@osdl.org \
    --cc=chris@ex-parrot.com \
    --cc=davem@davemloft.net \
    --cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).