* [PATCH net] bridge: vlan: fix usage of vlan 0 and 4095 again
@ 2015-07-02 12:48 Nikolay Aleksandrov
2015-07-02 15:46 ` Toshiaki Makita
2015-07-02 19:19 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Nikolay Aleksandrov @ 2015-07-02 12:48 UTC (permalink / raw)
To: netdev; +Cc: bridge, Nikolay Aleksandrov, vyasevich, davem, roopa
Vlan ids 0 and 4095 were disallowed by commit:
8adff41c3d25 ("bridge: Don't use VID 0 and 4095 in vlan filtering")
but then the check was removed when vlan ranges were introduced by:
bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
So reintroduce the vlan range check.
Before patch:
[root@testvm ~]# bridge vlan add vid 0 dev eth0 master
(succeeds)
After Patch:
[root@testvm ~]# bridge vlan add vid 0 dev eth0 master
RTNETLINK answers: Invalid argument
Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
---
net/bridge/br_netlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 6b67ed3831de..364bdc98bd9b 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -457,6 +457,8 @@ static int br_afspec(struct net_bridge *br,
if (nla_len(attr) != sizeof(struct bridge_vlan_info))
return -EINVAL;
vinfo = nla_data(attr);
+ if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK)
+ return -EINVAL;
if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) {
if (vinfo_start)
return -EINVAL;
--
2.4.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] bridge: vlan: fix usage of vlan 0 and 4095 again
2015-07-02 12:48 [PATCH net] bridge: vlan: fix usage of vlan 0 and 4095 again Nikolay Aleksandrov
@ 2015-07-02 15:46 ` Toshiaki Makita
2015-07-02 19:19 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Toshiaki Makita @ 2015-07-02 15:46 UTC (permalink / raw)
To: Nikolay Aleksandrov; +Cc: netdev, vyasevich, bridge, davem, roopa
On 15/07/02 (木) 21:48, Nikolay Aleksandrov wrote:
> Vlan ids 0 and 4095 were disallowed by commit:
> 8adff41c3d25 ("bridge: Don't use VID 0 and 4095 in vlan filtering")
> but then the check was removed when vlan ranges were introduced by:
> bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
> So reintroduce the vlan range check.
> Before patch:
> [root@testvm ~]# bridge vlan add vid 0 dev eth0 master
> (succeeds)
> After Patch:
> [root@testvm ~]# bridge vlan add vid 0 dev eth0 master
> RTNETLINK answers: Invalid argument
>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
Thank you for fixing this.
Acked-by: Toshiaki Makita <toshiaki.makita1@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] bridge: vlan: fix usage of vlan 0 and 4095 again
2015-07-02 12:48 [PATCH net] bridge: vlan: fix usage of vlan 0 and 4095 again Nikolay Aleksandrov
2015-07-02 15:46 ` Toshiaki Makita
@ 2015-07-02 19:19 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-07-02 19:19 UTC (permalink / raw)
To: nikolay; +Cc: netdev, vyasevich, bridge, roopa
From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Date: Thu, 2 Jul 2015 05:48:17 -0700
> Vlan ids 0 and 4095 were disallowed by commit:
> 8adff41c3d25 ("bridge: Don't use VID 0 and 4095 in vlan filtering")
> but then the check was removed when vlan ranges were introduced by:
> bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
> So reintroduce the vlan range check.
> Before patch:
> [root@testvm ~]# bridge vlan add vid 0 dev eth0 master
> (succeeds)
> After Patch:
> [root@testvm ~]# bridge vlan add vid 0 dev eth0 master
> RTNETLINK answers: Invalid argument
>
> Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> Fixes: bdced7ef7838 ("bridge: support for multiple vlans and vlan ranges in setlink and dellink requests")
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-07-02 19:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-02 12:48 [PATCH net] bridge: vlan: fix usage of vlan 0 and 4095 again Nikolay Aleksandrov
2015-07-02 15:46 ` Toshiaki Makita
2015-07-02 19:19 ` David Miller
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).