]> git.proxmox.com Git - mirror_ubuntu-zesty-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)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 27 Jun 2017 13:16:15 +0000 (10:16 -0300)
commit1610c847d3af85c49bbebc411e4b71c74515d603
treeeebecb5322339be2dfde69dd87685d5320eb3483
parent91b2e6b0188f8e5208bad1e4fef9face7bdaff52
bridge: netlink: check vlan_default_pvid range

BugLink: http://bugs.launchpad.net/bugs/1697001
[ Upstream commit a285860211bf257b0e6d522dac6006794be348af ]

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: 0f963b7592ef ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
net/bridge/br_netlink.c