net/sfc: check ID overflow in action port ID
The container in the action configuration is U32, but the ID is U16, and overflow check is missing. Fixes: 1fb65e4dae8a ("net/sfc: support flow action port ID in transfer rules") Cc: stable@dpdk.org Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru> Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Reviewed-by: Andy Moreton <amoreton@xilinx.com>
This commit is contained in:
parent
d96dccbc27
commit
fb3c4efb65
@ -2653,6 +2653,9 @@ sfc_mae_rule_parse_action_port_id(struct sfc_adapter *sa,
|
|||||||
uint16_t port_id;
|
uint16_t port_id;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
if (conf->id > UINT16_MAX)
|
||||||
|
return EOVERFLOW;
|
||||||
|
|
||||||
port_id = (conf->original != 0) ? sas->port_id : conf->id;
|
port_id = (conf->original != 0) ? sas->port_id : conf->id;
|
||||||
|
|
||||||
rc = sfc_mae_switch_port_by_ethdev(mae->switch_domain_id,
|
rc = sfc_mae_switch_port_by_ethdev(mae->switch_domain_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user