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 247A8A0032 for ; Fri, 18 Feb 2022 13:43:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F97240E2D; Fri, 18 Feb 2022 13:43:24 +0100 (CET) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mails.dpdk.org (Postfix) with ESMTP id 0E6C441143 for ; Fri, 18 Feb 2022 13:43:23 +0100 (CET) Received: by mail-wm1-f52.google.com with SMTP id i19so5147224wmq.5 for ; Fri, 18 Feb 2022 04:43:23 -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=OG5Ys6B+JwJmKa4PnauwY+l6Xz0L87qCg+5YFuH7+II=; b=S7hC9jfmRWDXpL783bLNM4mr8dh11mGn17kMbFbXn+c0Sfi+VfUBXsD4z7bQev2hUm QCeOSs44pKkHl0NpaOeFWqoCz4pXxrMpR7su+ncDe9zq00z86FQnuhre3QkPvC5xdx70 3+BJSaj7zeVfVncpDkSD5UpI+FlaHf1JbbH9xVWX3mvq1Njv36FahY8/eB5qUU/oKEs1 Q3rik/HllK0eyvJKpdkHe5hyyYfTnYpU7KfN1tmMgPDiQPpt7VBKlaqlGDgKOxZTWAJD vSUftLqgVQ4Gvnbq+NFLz/beueHUde7Gv3gqE88GTElF/frtoBIDSWPCVOSIU9L6tvRx LLPA== 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=OG5Ys6B+JwJmKa4PnauwY+l6Xz0L87qCg+5YFuH7+II=; b=DnjA9RkscrX9RzQgG8Y5bpts5YE9O0T6z5T6P5/G5i8bl25ZsZhZu0T6d8Yytsxyxj oECCtwdnC4Rsjeq7p5s8oBSJN1ZLNjNPMU3odW6kK1WnlDDQwNcB6SSxDH0hXQH7trhw rvLnRdnXXF5Ye3l78rU8oxvW2IZcV3N+qo7myV6PK11dalctKF3AnwVLNtTnv501MwuF aQ6QgXC1bd1s8bUJBIaJAaXI7xB/Eidq0z57PQBSscjJCLpov3ZjsBT37W8nasM5Fj2y mdUsEy3+gTz+9WMbfBIAS4fH+VGcdG/K70kv/9jQJXX2xw0X9sJoursU07hhuDjY/gJY q4Ag== X-Gm-Message-State: AOAM530ZLCEUlJ4t/Cg+L6ws2g+/k8jKLroqwgapUmzO75MwtV3+5YNX vESqy8fEP8fklJ1/Ik8baXg= X-Google-Smtp-Source: ABdhPJxASmZ+GlNTYN7JO+X8UD6Zs1syE0w6vxQkXRQdPtnXOvRwBPMWtYZ5P/rdELcR16nfKQMD2Q== X-Received: by 2002:a1c:43c3:0:b0:37b:c663:156c with SMTP id q186-20020a1c43c3000000b0037bc663156cmr7010648wma.140.1645188202693; Fri, 18 Feb 2022 04:43:22 -0800 (PST) Received: from localhost ([2a01:4b00:f41a:3600:360b:9754:2e3a:c344]) by smtp.gmail.com with ESMTPSA id u3sm5055350wmm.0.2022.02.18.04.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 04:43:21 -0800 (PST) From: luca.boccassi@gmail.com To: Zhihong Wang Cc: Liang Ma , =?UTF-8?q?Morten=20Br=C3=B8rup?= , Konstantin Ananyev , dpdk stable Subject: patch 'ring: fix overflow in memory size calculation' has been queued to stable release 20.11.5 Date: Fri, 18 Feb 2022 12:38:44 +0000 Message-Id: <20220218123931.1749595-75-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220218123931.1749595-1-luca.boccassi@gmail.com> References: <20220218123931.1749595-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 02/20/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/19746aaeabb2a7865a02e95d76f454529839a480 Thanks. Luca Boccassi --- >From 19746aaeabb2a7865a02e95d76f454529839a480 Mon Sep 17 00:00:00 2001 From: Zhihong Wang Date: Tue, 14 Dec 2021 11:30:16 +0800 Subject: [PATCH] ring: fix overflow in memory size calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 0e4dc6af06228c8504a5538512cb31ed7bf6cc23 ] Parameters count and esize are both unsigned int, and their product can legaly exceed unsigned int and lead to runtime access violation. Fixes: cc4b218790f6 ("ring: support configurable element size") Signed-off-by: Zhihong Wang Reviewed-by: Liang Ma Reviewed-by: Morten Brørup Acked-by: Konstantin Ananyev --- lib/librte_ring/rte_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c index 185f9be798..6a94a038c4 100644 --- a/lib/librte_ring/rte_ring.c +++ b/lib/librte_ring/rte_ring.c @@ -75,7 +75,7 @@ rte_ring_get_memsize_elem(unsigned int esize, unsigned int count) return -EINVAL; } - sz = sizeof(struct rte_ring) + count * esize; + sz = sizeof(struct rte_ring) + (ssize_t)count * esize; sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE); return sz; } -- 2.30.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-02-18 12:37:40.828207500 +0000 +++ 0075-ring-fix-overflow-in-memory-size-calculation.patch 2022-02-18 12:37:37.750793260 +0000 @@ -1 +1 @@ -From 0e4dc6af06228c8504a5538512cb31ed7bf6cc23 Mon Sep 17 00:00:00 2001 +From 19746aaeabb2a7865a02e95d76f454529839a480 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 0e4dc6af06228c8504a5538512cb31ed7bf6cc23 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ - lib/ring/rte_ring.c | 2 +- + lib/librte_ring/rte_ring.c | 2 +- @@ -23 +24 @@ -diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c +diff --git a/lib/librte_ring/rte_ring.c b/lib/librte_ring/rte_ring.c @@ -25,2 +26,2 @@ ---- a/lib/ring/rte_ring.c -+++ b/lib/ring/rte_ring.c +--- a/lib/librte_ring/rte_ring.c ++++ b/lib/librte_ring/rte_ring.c