From: Nikolay Aleksandrov Date: Mon, 12 Oct 2015 12:01:39 +0000 (+0200) Subject: switchdev: enforce no pvid flag in vlan ranges X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cc02aa8e41c50f690d0bb22ed5629468483421b7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git switchdev: enforce no pvid flag in vlan ranges We shouldn't allow BRIDGE_VLAN_INFO_PVID flag in VLAN ranges. Signed-off-by: Nikolay Aleksandrov Acked-by: Elad Raz Acked-by: Jiri Pirko Signed-off-by: David S. Miller --- diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 7a9ab90363be..b8aaf820ef65 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c @@ -727,6 +727,9 @@ static int switchdev_port_br_afspec(struct net_device *dev, if (vlan.vid_begin) return -EINVAL; vlan.vid_begin = vinfo->vid; + /* don't allow range of pvids */ + if (vlan.flags & BRIDGE_VLAN_INFO_PVID) + return -EINVAL; } else if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_END) { if (!vlan.vid_begin) return -EINVAL;