From: Ivan Malov <ivan.malov@oktetlabs.ru>
To: dev@dpdk.org
Cc: stable@dpdk.org, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
Andy Moreton <amoreton@xilinx.com>
Subject: [dpdk-dev] [PATCH] net/sfc: check for ID overflow in action PORT ID
Date: Thu, 27 May 2021 17:27:22 +0300 [thread overview]
Message-ID: <20210527142722.16129-1-ivan.malov@oktetlabs.ru> (raw)
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
next reply other threads:[~2021-05-27 14:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 14:27 Ivan Malov [this message]
2021-07-07 10:02 ` [dpdk-dev] [dpdk-stable] [PATCH] net/sfc: check for ID overflow in action PORT ID David Marchand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210527142722.16129-1-ivan.malov@oktetlabs.ru \
--to=ivan.malov@oktetlabs.ru \
--cc=amoreton@xilinx.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.