kernel: require admin permissions for swconfig set operations
authorFelix Fietkau <nbd@nbd.name>
Sun, 12 Jun 2016 10:03:11 +0000 (12:03 +0200)
committerFelix Fietkau <nbd@nbd.name>
Sun, 12 Jun 2016 10:03:20 +0000 (12:03 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/generic/files/drivers/net/phy/swconfig.c

index 699abd33dd894bd143ea72b6acf928184c78dadd..c70ca74cadde948bd330543cdf9811ce130899b1 100644 (file)
@@ -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,
        },