]> git.baikalelectronics.ru Git - kernel.git/commit
bridge: netlink: check vlan_default_pvid range
authorTobias Jungel <tobias.jungel@bisdn.de>
Wed, 17 May 2017 07:29:12 +0000 (09:29 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 18 May 2017 14:15:00 +0000 (10:15 -0400)
commit607581a5cd780dbd3b9f1d5cd69a1d4a96a6caaa
treef25f67fb0493c4280e3ec0cba341089f90db2524
parent060748b6a65cd62ebde9d6a42b394f924aa83bc5
bridge: netlink: check vlan_default_pvid range

Currently it is allowed to set the default pvid of a bridge to a value
above VLAN_VID_MASK (0xfff). This patch adds a check to br_validate and
returns -EINVAL in case the pvid is out of bounds.

Reproduce by calling:

[root@test ~]# ip l a type bridge
[root@test ~]# ip l a type dummy
[root@test ~]# ip l s bridge0 type bridge vlan_filtering 1
[root@test ~]# ip l s bridge0 type bridge vlan_default_pvid 9999
[root@test ~]# ip l s dummy0 master bridge0
[root@test ~]# bridge vlan
port vlan ids
bridge0  9999 PVID Egress Untagged

dummy0  9999 PVID Egress Untagged

Fixes: dedf1375d7bd ("bridge: netlink: add support for default_pvid")
Acked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
Signed-off-by: Tobias Jungel <tobias.jungel@bisdn.de>
Acked-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/bridge/br_netlink.c