summaryrefslogtreecommitdiff
path: root/net/8021q/vlanproc.c
diff options
context:
space:
mode:
authorWANG Cong <xiyou.wangcong@gmail.com>2014-07-26 02:25:10 +0400
committerDavid S. Miller <davem@davemloft.net>2014-07-29 22:43:50 +0400
commit9c5ff24f963919965155cf0c4a2323b22a0c5c84 (patch)
tree8be53cca32ce634c291589f161684913f42432ac /net/8021q/vlanproc.c
parenta317a2f19da7d0af1f068cf4d3ae80cdd73643b7 (diff)
downloadlinux-9c5ff24f963919965155cf0c4a2323b22a0c5c84.tar.xz
vlan: fail early when creating netdev named config
Similarly, vlan will create /proc/net/vlan/<dev>, so when we create dev with name "config", it will confict with /proc/net/vlan/config. Reported-by: Stephane Chazelas <stephane.chazelas@gmail.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlanproc.c')
-rw-r--r--net/8021q/vlanproc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c
index 1d0e89213a28..ae63cf72a953 100644
--- a/net/8021q/vlanproc.c
+++ b/net/8021q/vlanproc.c
@@ -171,6 +171,8 @@ int vlan_proc_add_dev(struct net_device *vlandev)
struct vlan_dev_priv *vlan = vlan_dev_priv(vlandev);
struct vlan_net *vn = net_generic(dev_net(vlandev), vlan_net_id);
+ if (!strcmp(vlandev->name, name_conf))
+ return -EINVAL;
vlan->dent =
proc_create_data(vlandev->name, S_IFREG|S_IRUSR|S_IWUSR,
vn->proc_vlan_dir, &vlandev_fops, vlandev);