summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Cormack <justin@myriabit.com>2015-05-13 19:19:02 +0100
committerDavid S. Miller <davem@davemloft.net>2015-05-13 14:21:36 -0400
commit7f460d30c8e130382de1443fdbc4d040a9e062ec (patch)
treee56dffd73bf6c04db68e4432057b1caecc02a24e
parent42275bd8fcb351f951781d8882f359d25976824b (diff)
downloadlinux-7f460d30c8e130382de1443fdbc4d040a9e062ec.tar.bz2
fix missing copy_from_user in macvtap
Fix missing copy_from_user in macvtap SIOCSIFHWADDR ioctl. Signed-off-by: Justin Cormack <justin@netbsd.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/macvtap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index c8a23896d54e..483afb19596c 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -1006,6 +1006,7 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
unsigned int __user *up = argp;
unsigned short u;
int __user *sp = argp;
+ struct sockaddr sa;
int s;
int ret;
@@ -1119,13 +1120,15 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd,
return ret;
case SIOCSIFHWADDR:
+ if (copy_from_user(&sa, &ifr->ifr_hwaddr, sizeof(sa)))
+ return -EFAULT;
rtnl_lock();
vlan = macvtap_get_vlan(q);
if (!vlan) {
rtnl_unlock();
return -ENOLINK;
}
- ret = dev_set_mac_address(vlan->dev, &ifr->ifr_hwaddr);
+ ret = dev_set_mac_address(vlan->dev, &sa);
macvtap_put_vlan(vlan);
rtnl_unlock();
return ret;