patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/sfc: check for ID overflow in action PORT ID
@ 2021-05-27 14:27 Ivan Malov
  2021-07-07 10:02 ` David Marchand
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Malov @ 2021-05-27 14:27 UTC (permalink / raw)
  To: dev; +Cc: stable, Andrew Rybchenko, Andy Moreton

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>
---
 drivers/net/sfc/sfc_mae.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/sfc/sfc_mae.c b/drivers/net/sfc/sfc_mae.c
index a2c0aa143..9b7163e82 100644
--- a/drivers/net/sfc/sfc_mae.c
+++ b/drivers/net/sfc/sfc_mae.c
@@ -2563,6 +2563,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,
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/sfc: check for ID overflow in action PORT ID
  2021-05-27 14:27 [dpdk-stable] [PATCH] net/sfc: check for ID overflow in action PORT ID Ivan Malov
@ 2021-07-07 10:02 ` David Marchand
  0 siblings, 0 replies; 2+ messages in thread
From: David Marchand @ 2021-07-07 10:02 UTC (permalink / raw)
  To: Ivan Malov; +Cc: dev, dpdk stable, Andrew Rybchenko, Andy Moreton

On Thu, May 27, 2021 at 4:27 PM Ivan Malov <ivan.malov@oktetlabs.ru> wrote:
>
> 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>

Applied, thanks.


-- 
David Marchand


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-07 10:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 14:27 [dpdk-stable] [PATCH] net/sfc: check for ID overflow in action PORT ID Ivan Malov
2021-07-07 10:02 ` David Marchand

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git