From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CF2C2A0547 for ; Thu, 27 May 2021 16:27:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C144441101; Thu, 27 May 2021 16:27:38 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id E195340143; Thu, 27 May 2021 16:27:35 +0200 (CEST) Received: from localhost.localdomain (unknown [5.144.120.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 39BEA7F510; Thu, 27 May 2021 17:27:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 39BEA7F510 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1622125655; bh=NthkmNgF8BV88eOKfRIgFatbm14QyEPJ4UEVce03aUU=; h=From:To:Cc:Subject:Date; b=wiRr8zLcgLCNh0mwCTfQbC37SqS5Z4G+I9Ai2er9/XrWXGugjZaiGu654w71cca2n sUCRqX9+QRxZPydYxUb8V345J03NHY8FD7dfkp5Nv5MWTP7thyBTqwy+BhA8X3tB+9 t5GW197PCifalKFXhYn59Cx1nnS0CyjAfvUQ5k+k= From: Ivan Malov To: dev@dpdk.org Cc: stable@dpdk.org, Andrew Rybchenko , Andy Moreton Date: Thu, 27 May 2021 17:27:22 +0300 Message-Id: <20210527142722.16129-1-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] net/sfc: check for ID overflow in action PORT ID X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- 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