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 B15B4A0350 for ; Mon, 28 Feb 2022 22:23:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5813411AB; Mon, 28 Feb 2022 22:23:21 +0100 (CET) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mails.dpdk.org (Postfix) with ESMTP id 5E4714067B for ; Mon, 28 Feb 2022 22:23:18 +0100 (CET) Received: by mail-wm1-f42.google.com with SMTP id bg16-20020a05600c3c9000b00380f6f473b0so202404wmb.1 for ; Mon, 28 Feb 2022 13:23:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1MdJQ0Fg/n2eo264y0aiJz9oMwxfXIfGB0nAn1rBrrY=; b=AzR2ci65lxU5ZtMx+QECN7Ni9OwPzUjKixRbVij5UVyuqYmy7u3s2N8aiDeWIXPmdR gPgz50/nHKA1ZsDG9m78pcApnQ6L8zruhdmi+mUH5RuypE7bdTwjnb0AGZA6FKk5kL+P ZfeNdPfvt6/m/OAjXoumuoPmtSzYtYCFrT0zd4KmjNx9PcMHDvwsOiEXHrDlYTYMysWz RVEWBK19koKYPRurFdqry2hMSFrgFapmpg7xZQThgd3zllLgHGXjRfmL8I+KCFskVuvH GbNuWyQHeswTeYGhoJ4T37KlXSNrDuGDRc01NhFM26H0ZsuCBRIH64wSaeXSD7qWwTeo tM8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1MdJQ0Fg/n2eo264y0aiJz9oMwxfXIfGB0nAn1rBrrY=; b=hG8wJqDe68fyrUKlRU6RKdyNKsd9QBPOQpTrwwxFJwAyNqfzXuyHo0BkNh+jJOvmni Civ1nigk9bf7HWmzzlVW8jdCAQrRb+uHVrZBICh/fkQwvVbEAhe2v1SIg09csOxouaoc X0LB5CE7ut42HV1mfZdIsIt5tCO4I4CnlJi8n4NLhQPPLScDVBv1JrkXcY7pD5rEpwvQ N/Lvkx5AOcWyR0iCWqWGZl3cviS1jNisklbhM/VTjV9EAt6b5EkIYWJybPAX592kjT2s S/Fc9bMIOk4zsZ8P9XUXvxBhG74eUwWkMjRuKSIhibhARVGYlbWWlsgbUZprOCBJxjue ebKw== X-Gm-Message-State: AOAM531LPR/9Cu+TL0Bh6bgtthdH4JWx51RTpxrNJ9ZsqA4IGjCxNUf0 xFTvrt+wbhftEuwWyuYcYWT6YMf7+HvBMD1R X-Google-Smtp-Source: ABdhPJycwur6VLkcyWWPOm1semGO4d8ct1P3lQ24GGYJ1zLA4XqUinrr7BDHmlQwYNZmwx6o0fE0FA== X-Received: by 2002:a7b:cb44:0:b0:37c:4e2d:3bb2 with SMTP id v4-20020a7bcb44000000b0037c4e2d3bb2mr14896667wmj.96.1646083398134; Mon, 28 Feb 2022 13:23:18 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id e22-20020adf9bd6000000b001eda1017861sm12052776wrc.64.2022.02.28.13.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 13:23:17 -0800 (PST) From: luca.boccassi@gmail.com To: Bruce Richardson Cc: David Hunt , dpdk stable Subject: patch 'distributor: fix potential overflow' has been queued to stable release 20.11.5 Date: Mon, 28 Feb 2022 21:20:45 +0000 Message-Id: <20220228212047.3341966-49-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220228212047.3341966-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-122-luca.boccassi@gmail.com> <20220228212047.3341966-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Hi, FYI, your patch has been queued to stable release 20.11.5 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/02/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/240dc513c2b191a30d4e0ee39bd97a39d5a30db6 Thanks. Luca Boccassi --- >From 240dc513c2b191a30d4e0ee39bd97a39d5a30db6 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Thu, 17 Feb 2022 15:02:39 +0000 Subject: [PATCH] distributor: fix potential overflow [ upstream commit 9699b09803b799ddc11abedffb17af059c992e9a ] Coverity flags the fact that the tag values used in distributor are 32-bit, which means that when we use bit-manipulation to convert a tag match/no-match to a bit in an array, we need to typecast to a 64-bit type before shifting past 32 bits. Coverity issue: 375808 Fixes: 08ccf3faa6a9 ("distributor: new packet distributor library") Signed-off-by: Bruce Richardson Acked-by: David Hunt --- lib/librte_distributor/rte_distributor_single.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/librte_distributor/rte_distributor_single.c b/lib/librte_distributor/rte_distributor_single.c index f4725b1d0b..e8a13ce980 100644 --- a/lib/librte_distributor/rte_distributor_single.c +++ b/lib/librte_distributor/rte_distributor_single.c @@ -249,8 +249,7 @@ rte_distributor_process_single(struct rte_distributor_single *d, * worker given by the bit-position */ for (i = 0; i < d->num_workers; i++) - match |= (!(d->in_flight_tags[i] ^ new_tag) - << i); + match |= ((uint64_t)!(d->in_flight_tags[i] ^ new_tag) << i); /* Only turned-on bits are considered as match */ match &= d->in_flight_bitmask; -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-28 21:17:57.886170148 +0000 +++ 0049-distributor-fix-potential-overflow.patch 2022-02-28 21:17:54.064934139 +0000 @@ -1 +1 @@ -From 9699b09803b799ddc11abedffb17af059c992e9a Mon Sep 17 00:00:00 2001 +From 240dc513c2b191a30d4e0ee39bd97a39d5a30db6 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 9699b09803b799ddc11abedffb17af059c992e9a ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -18 +19 @@ - lib/distributor/rte_distributor_single.c | 3 +-- + lib/librte_distributor/rte_distributor_single.c | 3 +-- @@ -21,5 +22,5 @@ -diff --git a/lib/distributor/rte_distributor_single.c b/lib/distributor/rte_distributor_single.c -index de90aa8bb5..2c77ac454a 100644 ---- a/lib/distributor/rte_distributor_single.c -+++ b/lib/distributor/rte_distributor_single.c -@@ -245,8 +245,7 @@ rte_distributor_process_single(struct rte_distributor_single *d, +diff --git a/lib/librte_distributor/rte_distributor_single.c b/lib/librte_distributor/rte_distributor_single.c +index f4725b1d0b..e8a13ce980 100644 +--- a/lib/librte_distributor/rte_distributor_single.c ++++ b/lib/librte_distributor/rte_distributor_single.c +@@ -249,8 +249,7 @@ rte_distributor_process_single(struct rte_distributor_single *d,