projects
/
openwrt
/
staging
/
noltari.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
kernel: deny swconfig set requests for unprivileged users
[openwrt/staging/noltari.git]
/
target
/
linux
/
generic
/
files
/
drivers
/
net
/
phy
/
swconfig.c
diff --git
a/target/linux/generic/files/drivers/net/phy/swconfig.c
b/target/linux/generic/files/drivers/net/phy/swconfig.c
index b556510aef2c557a2d44ac9276580f6f1be8e9a6..699abd33dd894bd143ea72b6acf928184c78dadd 100644
(file)
--- a/
target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/
target/linux/generic/files/drivers/net/phy/swconfig.c
@@
-635,6
+635,9
@@
swconfig_set_attr(struct sk_buff *skb, struct genl_info *info)
struct switch_val val;
int err = -EINVAL;
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
dev = swconfig_get_dev(info);
if (!dev)
return -EINVAL;