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 699abd3..c70ca74 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,
        },