]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: dsa: microchip: ksz9477: flower: validate control flags
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>
Thu, 11 Apr 2024 10:52:57 +0000 (10:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Apr 2024 09:33:14 +0000 (10:33 +0100)
Add check for unsupported control flags.

Only compile-tested, no access to HW.

Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz9477_tc_flower.c

index 8b2f5be667e01ff37b9408e21de39f20613670c3..ca7830ab168ac291575bdd18f15a04ac2a7caaf7 100644 (file)
@@ -124,6 +124,9 @@ static int ksz9477_flower_parse_key(struct ksz_device *dev, int port,
                return -EOPNOTSUPP;
        }
 
+       if (flow_rule_match_has_control_flags(rule, extack))
+               return -EOPNOTSUPP;
+
        if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_BASIC) ||
            flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
                ret = ksz9477_flower_parse_key_l2(dev, port, extack, rule,