All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: Disable defered bridge hooks by default
@ 2006-07-04  9:26 Patrick McHardy
  2006-07-04  9:27 ` Patrick McHardy
  0 siblings, 1 reply; 39+ messages in thread
From: Patrick McHardy @ 2006-07-04  9:26 UTC (permalink / raw)
  To: Bart De Schuymer; +Cc: Netfilter Development Mailinglist

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

Finally got to taking care of the first part of getting
rid of the defered bridge hooks. Bart, does this look
correct to you? This stuff confuses me badly :) Thanks.



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

[NETFILTER]: SCTP conntrack: fix crash triggered by packet without chunks

When a packet without any chunks is received, the newconntrack variable
in sctp_packet contains an out of bounds value that is used to look up an
pointer from the array of timeouts, which is then dereferenced, resulting
in a crash. Make sure at least a single chunk is present.

Problem noticed by George A. Theall <theall@tenablesecurity.com>

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

---
commit 4044a218db83433791d45cd453a6311d7dcbd17d
tree 37ea0a16426151bd3606264ea8c462bbf6f3decd
parent a39727f212426b9d5f9267b3318a2afaf9922d3b
author Patrick McHardy <kaber@trash.net> Fri, 30 Jun 2006 05:27:26 +0200
committer Patrick McHardy <kaber@trash.net> Fri, 30 Jun 2006 05:27:26 +0200

 net/ipv4/netfilter/ip_conntrack_proto_sctp.c |    2 +-
 net/netfilter/nf_conntrack_proto_sctp.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
index 0416073..2d3612c 100644
--- a/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
+++ b/net/ipv4/netfilter/ip_conntrack_proto_sctp.c
@@ -254,7 +254,7 @@ static int do_basic_checks(struct ip_con
 	}
 
 	DEBUGP("Basic checks passed\n");
-	return 0;
+	return count == 0;
 }
 
 static int new_state(enum ip_conntrack_dir dir,
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index 0c6da49..9dab81d 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -259,7 +259,7 @@ static int do_basic_checks(struct nf_con
 	}
 
 	DEBUGP("Basic checks passed\n");
-	return 0;
+	return count == 0;
 }
 
 static int new_state(enum ip_conntrack_dir dir,

^ permalink raw reply related	[flat|nested] 39+ messages in thread
[parent not found: <W8195318669268441152182124@nocme1bl6.telenet-ops.be>]
* Re:  RFC: Disable defered bridge hooks by default
@ 2006-07-07 10:17 bdschuym@pandora.be
  2006-07-07 10:24 ` Patrick McHardy
  0 siblings, 1 reply; 39+ messages in thread
From: bdschuym@pandora.be @ 2006-07-07 10:17 UTC (permalink / raw)
  To: Patrick McHardy, bdschuym@pandora.be
  Cc: Netfilter Development Mailinglist, Bart De Schuymer


>----- Oorspronkelijk bericht -----
>Van: Patrick McHardy [mailto:kaber@trash.net]
>Verzonden: vrijdag, juli 7, 2006 05:37 AM
>Aan: bdschuym@pandora.be
>CC: 'Bart De Schuymer', 'Netfilter Development Mailinglist'
>Onderwerp: Re: RFC: Disable defered bridge hooks by default
>
>bdschuym@pandora.be wrote:
>> Looks good, but please use deferred instead of defered :)
>
>This is the latest version. Fixed the crash and added a
>runtime warning to the physdev match and on-the-fly activation
>when needed, so we don't need the sysctls. Works fine in
>a few simple tests, if there are no further objections
>I'll submit this version.

I'd add something like the code below on top of your patch. That way no false warnings are given if the user specifies she only wants to look at bridged packets.

cheers,
Bart

--- net/netfilter/xt_physdev.c.old	2006-07-07 12:11:44.000000000 +0200
+++ net/netfilter/xt_physdev.c	2006-07-07 12:14:14.000000000 +0200
@@ -114,7 +114,9 @@ checkentry(const char *tablename,
 	    info->bitmask & ~XT_PHYSDEV_OP_MASK)
 		return 0;
 	if (brnf_deferred_hooks == 0 && info->bitmask & XT_PHYSDEV_OP_OUT &&
-	    hook_mask & ((1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD))) {
+	    hook_mask & ((1 << NF_IP_LOCAL_OUT) | (1 << NF_IP_FORWARD)) &&
+	    (!(info->bitmask & XT_PHYSDEV_OP_BRIDGED) ||
+	       info->invert & XT_PHYSDEV_OP_BRIDGED)) {
 		printk(KERN_WARNING "physdev match: using --physdev-out in the "
 		       "OUTPUT or FORWARD chain is deprecated and breaks other "
 		       "things, it will be removed in January 2007. See "

>

^ permalink raw reply	[flat|nested] 39+ messages in thread
* Re:  RFC: Disable defered bridge hooks by default
@ 2006-07-13 12:56 bdschuym@pandora.be
  2006-07-13 14:38 ` Patrick McHardy
  0 siblings, 1 reply; 39+ messages in thread
From: bdschuym@pandora.be @ 2006-07-13 12:56 UTC (permalink / raw)
  To: Patrick McHardy, Philip Craig
  Cc: Netfilter Development Mailinglist, Bart De Schuymer, Tom Eastep


>----- Oorspronkelijk bericht -----
>Van: Patrick McHardy [mailto:kaber@trash.net]
>Verzonden: donderdag, juli 13, 2006 10:36 AM
>Aan: 'Philip Craig'
>CC: 'Netfilter Development Mailinglist', 'Bart De Schuymer', 'Tom Eastep'
>Onderwerp: Re: RFC: Disable defered bridge hooks by default
>
>On Thu, 13 Jul 2006, Philip Craig wrote:
>
>> Patrick McHardy wrote:
>>> On Wed, 12 Jul 2006, Philip Craig wrote:
>>>
>>>> Patrick McHardy wrote:
>>>> Would it be possible to call the bridging code from the iptables
>>>> forward/output hooks, store the result somewhere, and then when the
>>>> packet is passed to the bridge device, just use the stored result?
>>>> So fix the problem by calling bridging early, instead of deferring
>>>> iptables?  I'm not sure if this could handle packets that need to
>>>> be sent out multiple ports.
>>>
>>> No, it couldn't. Its questionable behaviour to do this anyway, think
>>> about something you REJECT without looking at the output port - you
>>> will reject once for each output port. The entire idea of using
>>> iptables from the bridge code seems flawed to me. Conntrack might
>>> also get very confused under certain cicurstances.
>>
>> These are also problems for purely bridged packets.  br_flood calls
>> __br_forward for every port, which calls the bridge forward hook, and
>> that passes the packet on to the ipv4 forward hook.  Should this be
>> changed so that the ipv4 forward hook is called earlier, and filtering
>> on output port is never possible?
>
>As I already mentioned in this thread, I believe the concept of calling
>iptables from briding is flawed. We have ebtables to do filtering within
>a bridge. But this is getting slightly off-topic.

ebtables can't do things like stateful IP firewalling. IMO, things like 
transparent stateful firewalling are way too cool to just throw out of Linux 
because it troubles iptables somewhat in special cases.

cheers,
Bart

^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2006-07-19 17:15 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-04  9:26 RFC: Disable defered bridge hooks by default Patrick McHardy
2006-07-04  9:27 ` Patrick McHardy
2006-07-08  0:36   ` Tom Eastep
2006-07-08  3:01     ` Patrick McHardy
2006-07-10  9:56       ` Amin Azez
2006-07-11  8:28         ` Patrick McHardy
2006-07-11  9:33           ` Amin Azez
2006-07-11 20:34       ` Tom Eastep
2006-07-11 21:29         ` Patrick McHardy
2006-07-12 22:41           ` Tom Eastep
2006-07-13  7:35             ` Patrick McHardy
2006-07-13 14:11               ` Tom Eastep
2006-07-13 14:45                 ` Patrick McHardy
2006-07-13 15:31                   ` Tom Eastep
2006-07-15 14:32                     ` Tom Eastep
2006-07-19 14:21                     ` Patrick McHardy
2006-07-19 15:50                       ` Tom Eastep
2006-07-19 16:02                         ` Patrick McHardy
2006-07-13  9:56             ` Amin Azez
2006-07-12  6:16       ` Philip Craig
2006-07-13  0:20         ` Tom Eastep
2006-07-13  0:42           ` David Miller
2006-07-13  0:45             ` Tom Eastep
2006-07-13  9:45               ` Amin Azez
2006-07-13  7:31           ` Patrick McHardy
2006-07-13  7:46         ` Patrick McHardy
2006-07-13  8:12           ` Philip Craig
2006-07-13  8:36             ` Patrick McHardy
2006-07-13 14:11           ` Amin Azez
2006-07-13 14:50             ` Patrick McHardy
2006-07-13 15:29               ` Amin Azez
2006-07-19 16:36                 ` Patrick McHardy
     [not found]                   ` <44BE624E.5080307@ufomechanic.net>
2006-07-19 17:15                     ` Patrick McHardy
     [not found] <W8195318669268441152182124@nocme1bl6.telenet-ops.be>
2006-07-06 10:49 ` Patrick McHardy
2006-07-07  3:37 ` Patrick McHardy
  -- strict thread matches above, loose matches on Subject: below --
2006-07-07 10:17 bdschuym@pandora.be
2006-07-07 10:24 ` Patrick McHardy
2006-07-13 12:56 bdschuym@pandora.be
2006-07-13 14:38 ` Patrick McHardy

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.