netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] netfilter: ebtables: make broute table work again
@ 2011-01-10 16:20 Florian Westphal
  2011-01-10 16:28 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2011-01-10 16:20 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Eric Dumazet

broute table init hook sets up the "br_should_route_hook" pointer,
which then gets called from br_input.

commit a386f99025f13b32502fe5dedf223c20d7283826
(bridge: add proper RCU annotation to should_route_hook)
introduced a typedef, and then changed this to:

br_should_route_hook_t *rhook;
[..]
rhook = rcu_dereference(br_should_route_hook);
if (*rhook(skb))

problem is that "br_should_route_hook" contains the address of the function,
so calling *rhook() results in kernel panic.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
---
 include/linux/if_bridge.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index f7e73c3..dd3f201 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -103,7 +103,7 @@ struct __fdb_entry {
 
 extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
 
-typedef int (*br_should_route_hook_t)(struct sk_buff *skb);
+typedef int br_should_route_hook_t(struct sk_buff *skb);
 extern br_should_route_hook_t __rcu *br_should_route_hook;
 
 #endif
-- 
1.7.2.2

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

* Re: [PATCH v2] netfilter: ebtables: make broute table work again
  2011-01-10 16:20 [PATCH v2] netfilter: ebtables: make broute table work again Florian Westphal
@ 2011-01-10 16:28 ` Eric Dumazet
  2011-01-10 19:51   ` Pablo Neira Ayuso
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2011-01-10 16:28 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

Le lundi 10 janvier 2011 à 17:20 +0100, Florian Westphal a écrit :
> broute table init hook sets up the "br_should_route_hook" pointer,
> which then gets called from br_input.
> 
> commit a386f99025f13b32502fe5dedf223c20d7283826
> (bridge: add proper RCU annotation to should_route_hook)
> introduced a typedef, and then changed this to:
> 
> br_should_route_hook_t *rhook;
> [..]
> rhook = rcu_dereference(br_should_route_hook);
> if (*rhook(skb))
> 
> problem is that "br_should_route_hook" contains the address of the function,
> so calling *rhook() results in kernel panic.
> 
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---
>  include/linux/if_bridge.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
> index f7e73c3..dd3f201 100644
> --- a/include/linux/if_bridge.h
> +++ b/include/linux/if_bridge.h
> @@ -103,7 +103,7 @@ struct __fdb_entry {
>  
>  extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
>  
> -typedef int (*br_should_route_hook_t)(struct sk_buff *skb);
> +typedef int br_should_route_hook_t(struct sk_buff *skb);
>  extern br_should_route_hook_t __rcu *br_should_route_hook;
>  
>  #endif

Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Thanks !


--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH v2] netfilter: ebtables: make broute table work again
  2011-01-10 16:28 ` Eric Dumazet
@ 2011-01-10 19:51   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2011-01-10 19:51 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Florian Westphal, netfilter-devel

On 10/01/11 17:28, Eric Dumazet wrote:
> Le lundi 10 janvier 2011 à 17:20 +0100, Florian Westphal a écrit :
>> broute table init hook sets up the "br_should_route_hook" pointer,
>> which then gets called from br_input.
>>
>> commit a386f99025f13b32502fe5dedf223c20d7283826
>> (bridge: add proper RCU annotation to should_route_hook)
>> introduced a typedef, and then changed this to:
>>
>> br_should_route_hook_t *rhook;
>> [..]
>> rhook = rcu_dereference(br_should_route_hook);
>> if (*rhook(skb))
>>
>> problem is that "br_should_route_hook" contains the address of the function,
>> so calling *rhook() results in kernel panic.
>>
>> Cc: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Florian Westphal <fw@strlen.de>
>> ---
>>  include/linux/if_bridge.h |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
>> index f7e73c3..dd3f201 100644
>> --- a/include/linux/if_bridge.h
>> +++ b/include/linux/if_bridge.h
>> @@ -103,7 +103,7 @@ struct __fdb_entry {
>>  
>>  extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
>>  
>> -typedef int (*br_should_route_hook_t)(struct sk_buff *skb);
>> +typedef int br_should_route_hook_t(struct sk_buff *skb);
>>  extern br_should_route_hook_t __rcu *br_should_route_hook;
>>  
>>  #endif
> 
> Acked-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied, thanks guys!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2011-01-10 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-10 16:20 [PATCH v2] netfilter: ebtables: make broute table work again Florian Westphal
2011-01-10 16:28 ` Eric Dumazet
2011-01-10 19:51   ` Pablo Neira Ayuso

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).