aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-06-12 12:03:11 +0200
committerFelix Fietkau <nbd@nbd.name>2016-06-12 12:03:20 +0200
commit37cfc23cb7bcfd90da137c0495303b19ddcf4b42 (patch)
tree8cad704709d3858ce377db940306d55354fe03c3
parentfecd715ef820d36e262c04ffba5d0d8968ce1ddb (diff)
downloadupstream-37cfc23cb7bcfd90da137c0495303b19ddcf4b42.tar.gz
upstream-37cfc23cb7bcfd90da137c0495303b19ddcf4b42.tar.bz2
upstream-37cfc23cb7bcfd90da137c0495303b19ddcf4b42.zip
kernel: require admin permissions for swconfig set operations
Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--target/linux/generic/files/drivers/net/phy/swconfig.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index 699abd33dd..c70ca74cad 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -1025,16 +1025,19 @@ static struct genl_ops swconfig_ops[] = {
},
{
.cmd = SWITCH_CMD_SET_GLOBAL,
+ .flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
.policy = switch_policy,
},
{
.cmd = SWITCH_CMD_SET_VLAN,
+ .flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
.policy = switch_policy,
},
{
.cmd = SWITCH_CMD_SET_PORT,
+ .flags = GENL_ADMIN_PERM,
.doit = swconfig_set_attr,
.policy = switch_policy,
},