Skip to content

Commit

Permalink
net/sfc: check ID overflow in action port ID
Browse files Browse the repository at this point in the history
[ upstream commit fb3c4ef ]

The container in the action configuration is U32,
but the ID is U16, and overflow check is missing.

Fixes: 1fb65e4 ("net/sfc: support flow action port ID in transfer rules")

Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
  • Loading branch information
ol-ivanmal authored and bluca committed Jul 12, 2021
1 parent 7d1f406 commit 810cbe8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/sfc/sfc_mae.c
Expand Up @@ -2000,6 +2000,9 @@ sfc_mae_rule_parse_action_port_id(struct sfc_adapter *sa,
uint16_t port_id;
int rc;

if (conf->id > UINT16_MAX)
return EOVERFLOW;

port_id = (conf->original != 0) ? sas->port_id : conf->id;

rc = sfc_mae_switch_port_by_ethdev(mae->switch_domain_id,
Expand Down

0 comments on commit 810cbe8

Please sign in to comment.