All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bridge: Fix br_should_learn to check vlan_enabled
@ 2014-09-15 19:24 Vladislav Yasevich
  2014-09-15 21:38 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Vladislav Yasevich @ 2014-09-15 19:24 UTC (permalink / raw)
  To: netdev; +Cc: toshiaki.makita1, Vladislav Yasevich

As Toshiaki Makita pointed out, the BRIDGE_INPUT_SKB_CB will
not be initialized in br_should_learn() as that function
is called only from br_handle_local_finish().  That is
an input handler for link-local ethernet traffic so it perfectly
correct to check br->vlan_enabled here.

Reported-by: Toshiaki Makita<toshiaki.makita1@gmail.com>
Fixes: 20adfa1 bridge: Check if vlan filtering is enabled only once.
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
 net/bridge/br_vlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 4b86738..3ba57fc 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -280,7 +280,7 @@ bool br_should_learn(struct net_bridge_port *p, struct sk_buff *skb, u16 *vid)
 	struct net_port_vlans *v;
 
 	/* If filtering was disabled at input, let it pass. */
-	if (!BR_INPUT_SKB_CB(skb)->vlan_filtered)
+	if (!br->vlan_enabled)
 		return true;
 
 	v = rcu_dereference(p->vlan_info);
-- 
1.9.3

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

* Re: [PATCH] bridge: Fix br_should_learn to check vlan_enabled
  2014-09-15 19:24 [PATCH] bridge: Fix br_should_learn to check vlan_enabled Vladislav Yasevich
@ 2014-09-15 21:38 ` David Miller
  2014-09-16 10:40   ` Toshiaki Makita
  0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2014-09-15 21:38 UTC (permalink / raw)
  To: vyasevich; +Cc: netdev, toshiaki.makita1, vyasevic

From: Vladislav Yasevich <vyasevich@gmail.com>
Date: Mon, 15 Sep 2014 15:24:26 -0400

> As Toshiaki Makita pointed out, the BRIDGE_INPUT_SKB_CB will
> not be initialized in br_should_learn() as that function
> is called only from br_handle_local_finish().  That is
> an input handler for link-local ethernet traffic so it perfectly
> correct to check br->vlan_enabled here.
> 
> Reported-by: Toshiaki Makita<toshiaki.makita1@gmail.com>
> Fixes: 20adfa1 bridge: Check if vlan filtering is enabled only once.
> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>

Applied, thanks Vlad.

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

* Re: [PATCH] bridge: Fix br_should_learn to check vlan_enabled
  2014-09-15 21:38 ` David Miller
@ 2014-09-16 10:40   ` Toshiaki Makita
  2014-09-16 14:02     ` Toshiaki Makita
  2014-09-16 16:05     ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Toshiaki Makita @ 2014-09-16 10:40 UTC (permalink / raw)
  To: David Miller, vyasevich; +Cc: netdev, toshiaki.makita1, vyasevic

On 2014/09/16 6:38, David Miller wrote:
> From: Vladislav Yasevich <vyasevich@gmail.com>
> Date: Mon, 15 Sep 2014 15:24:26 -0400
> 
>> As Toshiaki Makita pointed out, the BRIDGE_INPUT_SKB_CB will
>> not be initialized in br_should_learn() as that function
>> is called only from br_handle_local_finish().  That is
>> an input handler for link-local ethernet traffic so it perfectly
>> correct to check br->vlan_enabled here.
>>
>> Reported-by: Toshiaki Makita<toshiaki.makita1@gmail.com>
>> Fixes: 20adfa1 bridge: Check if vlan filtering is enabled only once.
>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
> 
> Applied, thanks Vlad.

Hi David,

Could you queue this for -stable as well?
Without this, FDB can be poisoned by disallowed ports.
(the same problem as stated in e0d7968ab6c8 "bridge: Prevent insertion
of FDB entry with disallowed vlan")

Thanks,
Toshiaki Makita

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

* Re: [PATCH] bridge: Fix br_should_learn to check vlan_enabled
  2014-09-16 10:40   ` Toshiaki Makita
@ 2014-09-16 14:02     ` Toshiaki Makita
  2014-09-16 16:16       ` David Miller
  2014-09-16 16:05     ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Toshiaki Makita @ 2014-09-16 14:02 UTC (permalink / raw)
  To: Toshiaki Makita, David Miller, vyasevich; +Cc: netdev, vyasevic

(14/09/16 (火) 19:40), Toshiaki Makita wrote:
> On 2014/09/16 6:38, David Miller wrote:
>> From: Vladislav Yasevich <vyasevich@gmail.com>
>> Date: Mon, 15 Sep 2014 15:24:26 -0400
>>
>>> As Toshiaki Makita pointed out, the BRIDGE_INPUT_SKB_CB will
>>> not be initialized in br_should_learn() as that function
>>> is called only from br_handle_local_finish().  That is
>>> an input handler for link-local ethernet traffic so it perfectly
>>> correct to check br->vlan_enabled here.
>>>
>>> Reported-by: Toshiaki Makita<toshiaki.makita1@gmail.com>
>>> Fixes: 20adfa1 bridge: Check if vlan filtering is enabled only once.
>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>>
>> Applied, thanks Vlad.
>
> Hi David,
>
> Could you queue this for -stable as well?
> Without this, FDB can be poisoned by disallowed ports.
> (the same problem as stated in e0d7968ab6c8 "bridge: Prevent insertion
> of FDB entry with disallowed vlan")

I'm sorry, I was confusued.
This doesn't cause that problem, because if vlan_filtered is 0, fdb is 
always updated with vid 0. Such an entry is never used as long as 
vlan_filtering is enabled.
Please ignore my previous mail.

Thanks,
Toshiaki Makita

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

* Re: [PATCH] bridge: Fix br_should_learn to check vlan_enabled
  2014-09-16 10:40   ` Toshiaki Makita
  2014-09-16 14:02     ` Toshiaki Makita
@ 2014-09-16 16:05     ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2014-09-16 16:05 UTC (permalink / raw)
  To: makita.toshiaki; +Cc: vyasevich, netdev, toshiaki.makita1, vyasevic

From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Tue, 16 Sep 2014 19:40:43 +0900

> On 2014/09/16 6:38, David Miller wrote:
>> From: Vladislav Yasevich <vyasevich@gmail.com>
>> Date: Mon, 15 Sep 2014 15:24:26 -0400
>> 
>>> As Toshiaki Makita pointed out, the BRIDGE_INPUT_SKB_CB will
>>> not be initialized in br_should_learn() as that function
>>> is called only from br_handle_local_finish().  That is
>>> an input handler for link-local ethernet traffic so it perfectly
>>> correct to check br->vlan_enabled here.
>>>
>>> Reported-by: Toshiaki Makita<toshiaki.makita1@gmail.com>
>>> Fixes: 20adfa1 bridge: Check if vlan filtering is enabled only once.
>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>> 
>> Applied, thanks Vlad.
> 
> Hi David,
> 
> Could you queue this for -stable as well?

Done.

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

* Re: [PATCH] bridge: Fix br_should_learn to check vlan_enabled
  2014-09-16 14:02     ` Toshiaki Makita
@ 2014-09-16 16:16       ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-09-16 16:16 UTC (permalink / raw)
  To: toshiaki.makita1; +Cc: makita.toshiaki, vyasevich, netdev, vyasevic

From: Toshiaki Makita <toshiaki.makita1@gmail.com>
Date: Tue, 16 Sep 2014 23:02:43 +0900

> (14/09/16 (火) 19:40), Toshiaki Makita wrote:
>> On 2014/09/16 6:38, David Miller wrote:
>>> From: Vladislav Yasevich <vyasevich@gmail.com>
>>> Date: Mon, 15 Sep 2014 15:24:26 -0400
>>>
>>>> As Toshiaki Makita pointed out, the BRIDGE_INPUT_SKB_CB will
>>>> not be initialized in br_should_learn() as that function
>>>> is called only from br_handle_local_finish().  That is
>>>> an input handler for link-local ethernet traffic so it perfectly
>>>> correct to check br->vlan_enabled here.
>>>>
>>>> Reported-by: Toshiaki Makita<toshiaki.makita1@gmail.com>
>>>> Fixes: 20adfa1 bridge: Check if vlan filtering is enabled only once.
>>>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>>>
>>> Applied, thanks Vlad.
>>
>> Hi David,
>>
>> Could you queue this for -stable as well?
>> Without this, FDB can be poisoned by disallowed ports.
>> (the same problem as stated in e0d7968ab6c8 "bridge: Prevent insertion
>> of FDB entry with disallowed vlan")
> 
> I'm sorry, I was confusued.
> This doesn't cause that problem, because if vlan_filtered is 0, fdb is
> always updated with vid 0. Such an entry is never used as long as
> vlan_filtering is enabled.
> Please ignore my previous mail.

Ok.

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

end of thread, other threads:[~2014-09-16 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-15 19:24 [PATCH] bridge: Fix br_should_learn to check vlan_enabled Vladislav Yasevich
2014-09-15 21:38 ` David Miller
2014-09-16 10:40   ` Toshiaki Makita
2014-09-16 14:02     ` Toshiaki Makita
2014-09-16 16:16       ` David Miller
2014-09-16 16:05     ` David Miller

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.