Skip to contentSkip to conversation

Patch "bridge: netlink: check vlan_default_pvid range" has been added to the 4.11-stable tree

PATCH [email protected] 1 participant 1 message May 31, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

bridge: netlink: check vlan_default_pvid range

to the 4.11-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
bridge-netlink-check-vlan_default_pvid-range.patch
and it can be found in the queue-4.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Wed May 31 09:13:10 JST 2017

From: Tobias Jungel <[email protected]>
Date: Wed, 17 May 2017 09:29:12 +0200
Subject: bridge: netlink: check vlan_default_pvid range

From: Tobias Jungel <[email protected]>

[ 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")
---
 net/bridge/br_netlink.c |    7 +++++++
 1 file changed, 7 insertions(+)
net/bridge/br_netlink.c +7 -0
@@ -828,6 +828,13 @@ static int br_validate(struct nlattr *tb
 			return -EPROTONOSUPPORT;
 		}
 	}
+
+	if (data[IFLA_BR_VLAN_DEFAULT_PVID]) {
+		__u16 defpvid = nla_get_u16(data[IFLA_BR_VLAN_DEFAULT_PVID]);
+
+		if (defpvid >= VLAN_VID_MASK)
+			return -EINVAL;
+	}
 #endif
 
 	return 0;

Patches currently in stable-queue which might be from [email protected] are

queue-4.11/bridge-netlink-check-vlan_default_pvid-range.patch