net: prestera: flower: validate control flags
authorAsbjørn Sloth Tønnesen <ast@fiberby.net>
Thu, 11 Apr 2024 10:52:56 +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/ethernet/marvell/prestera/prestera_flower.c

index 8b9455d..418101a 100644 (file)
@@ -229,6 +229,10 @@ static int prestera_flower_parse(struct prestera_flow_block *block,
 
                flow_rule_match_control(f_rule, &match);
                addr_type = match.key->addr_type;
+
+               if (flow_rule_has_control_flags(match.mask->flags,
+                                               f->common.extack))
+                       return -EOPNOTSUPP;
        }
 
        if (flow_rule_match_key(f_rule, FLOW_DISSECTOR_KEY_BASIC)) {