|
@@ -731,14 +731,9 @@ static int update_filter(struct tap_filter *filter, void __user *arg)
|
|
}
|
|
}
|
|
|
|
|
|
alen = ETH_ALEN * uf.count;
|
|
alen = ETH_ALEN * uf.count;
|
|
- addr = kmalloc(alen, GFP_KERNEL);
|
|
|
|
- if (!addr)
|
|
|
|
- return -ENOMEM;
|
|
|
|
-
|
|
|
|
- if (copy_from_user(addr, arg + sizeof(uf), alen)) {
|
|
|
|
- err = -EFAULT;
|
|
|
|
- goto done;
|
|
|
|
- }
|
|
|
|
|
|
+ addr = memdup_user(arg + sizeof(uf), alen);
|
|
|
|
+ if (IS_ERR(addr))
|
|
|
|
+ return PTR_ERR(addr);
|
|
|
|
|
|
/* The filter is updated without holding any locks. Which is
|
|
/* The filter is updated without holding any locks. Which is
|
|
* perfectly safe. We disable it first and in the worst
|
|
* perfectly safe. We disable it first and in the worst
|