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 B09ECA0093 for ; Wed, 9 Mar 2022 12:03:39 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC5DB40150; Wed, 9 Mar 2022 12:03:39 +0100 (CET) Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by mails.dpdk.org (Postfix) with ESMTP id 6050540150 for ; Wed, 9 Mar 2022 12:03:39 +0100 (CET) Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (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 smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id EB05A3F79D for ; Wed, 9 Mar 2022 11:03:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646823818; bh=wRHpYqEzXQps0yoBq7LSJC0Xq/cYx5GjTGVx8T+H7p4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Vl6zBGu1VcZLlCV/Dl917y8gQCYrdgK1j+AdU7nFeq3JjW5vJduELOxTYArcquhm2 25Ijv1fyLpEeMj7u8AbBMXhAeO3W5df45pp0GhlLdgz+1tD0N7MFHWOivUWPoj3oIs JfxcdzvgtP3rz+pPb6wJeOELg6z2O1Xdoc2pI9in3XHm1wqAbgmDQWy6dGWizgiVMQ pvibI53QiFFNElS0FKGGGSnYBWMJIKvEHhDY1zmKc4svi6NxgkDFPCz2TyyuDUmyim M5ivrH1ODixvoRY9lPBupFbET1WGP6v6sIlUEKv4u6QRL8w6AmK0lUeaxQSsagyMIm hJ95UQszJbabg== Received: by mail-ed1-f70.google.com with SMTP id bd4-20020a056402206400b004162b6d8618so1061209edb.19 for ; Wed, 09 Mar 2022 03:03:38 -0800 (PST) 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=wRHpYqEzXQps0yoBq7LSJC0Xq/cYx5GjTGVx8T+H7p4=; b=McBTVQNcpBibH3uR8sPPJnNW0UvrKgUMbgzBsvJ+bvBCXPgviz4lMD1cqXu947dlap FK1qsMA2e9WQlLIHBVRUMgbojo2lO3yIbU529Ivq0QTGwjrJ33QmqT6AoKC3oGqyYdb2 d6q5tY8wdwPFE3nVJpD/FSlvG2uqP3JkXUhWxmDvRH71e7278udl5QQx6qt1E8KqYtBW 0VBlUU20LlCbWn838Iybw0OgqUgCXv7LZ2l+TBX8/wTGdrfPvMOEfRzjgD91sfHhPSSt 5lkmHb7kta2lmZjmME6b3XALYESwX2Jl3sXMMKFERGYMkkcj3YK/7wOwa5vbqH1xZKbz NZfw== X-Gm-Message-State: AOAM532cR1x9OW3NTXuJjOFbEc83otSUB9PGMIir4BtsNh5uikua1Eit IcrbVFyNdUokYhujktjyAkSF+p+JjhInj09N4tQDfFH4G+1N6b/UPkgiK6arXg1pFEwBWkcfjP3 y6qb6ldoCVKjVf+Lcw8FXvI7c X-Received: by 2002:a17:907:2d25:b0:6d7:c831:5714 with SMTP id gs37-20020a1709072d2500b006d7c8315714mr17402655ejc.137.1646823817675; Wed, 09 Mar 2022 03:03:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJynCg2jbKPmzv9pxEYHG5M1JBq0qFv2hgbpLl2NIzGPMImv+lF+NCo0TFL6S/bBuWdvLpGuNQ== X-Received: by 2002:a17:907:2d25:b0:6d7:c831:5714 with SMTP id gs37-20020a1709072d2500b006d7c8315714mr17402638ejc.137.1646823817458; Wed, 09 Mar 2022 03:03:37 -0800 (PST) Received: from localhost.localdomain (068-133-067-156.ip-addr.inexio.net. [156.67.133.68]) by smtp.gmail.com with ESMTPSA id kq26-20020a170906abda00b006da87077172sm609472ejb.29.2022.03.09.03.03.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Mar 2022 03:03:37 -0800 (PST) From: christian.ehrhardt@canonical.com To: Reshma Pattan Cc: Stephen Hemminger , dpdk stable Subject: patch 'app/pdump: abort on multi-core capture limit' has been queued to stable release 19.11.12 Date: Wed, 9 Mar 2022 12:01:12 +0100 Message-Id: <20220309110116.1295395-41-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220309110116.1295395-1-christian.ehrhardt@canonical.com> References: <20220309110116.1295395-1-christian.ehrhardt@canonical.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 19.11.12 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/11/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/cpaelzer/dpdk-stable-queue This queued commit can be viewed at: https://github.com/cpaelzer/dpdk-stable-queue/commit/e980bd3f16782be650fa286adedefc3644bc35e4 Thanks. Christian Ehrhardt --- >From e980bd3f16782be650fa286adedefc3644bc35e4 Mon Sep 17 00:00:00 2001 From: Reshma Pattan Date: Mon, 28 Feb 2022 09:58:56 +0000 Subject: [PATCH] app/pdump: abort on multi-core capture limit [ upstream commit 3ee04ebc91f3872c4c1d9f9911f0cdfa32377d8c ] Check lcore id value is not the maximum core supported. Using lcore id without this check might cause out of bound access inside the rte_eal_wait_lcore. Coverity issue: 375841 Fixes: b2854d5317e8 ("app/pdump: support multi-core capture") Signed-off-by: Reshma Pattan Acked-by: Stephen Hemminger --- app/pdump/main.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/pdump/main.c b/app/pdump/main.c index c38c53719e..99ef010d13 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -906,11 +906,21 @@ dump_packets_core(void *arg) return 0; } +static unsigned int +get_next_core(unsigned int lcore) +{ + lcore = rte_get_next_lcore(lcore, 1, 0); + if (lcore == RTE_MAX_LCORE) + rte_exit(EXIT_FAILURE, + "Max core limit %u reached for packet capture", lcore); + return lcore; +} + static inline void dump_packets(void) { int i; - uint32_t lcore_id = 0; + unsigned int lcore_id = 0; if (!multiple_core_capture) { printf(" core (%u), capture for (%d) tuples\n", @@ -936,12 +946,12 @@ dump_packets(void) return; } - lcore_id = rte_get_next_lcore(lcore_id, 1, 0); + lcore_id = get_next_core(lcore_id); for (i = 0; i < num_tuples; i++) { rte_eal_remote_launch(dump_packets_core, &pdump_t[i], lcore_id); - lcore_id = rte_get_next_lcore(lcore_id, 1, 0); + lcore_id = get_next_core(lcore_id); if (rte_eal_wait_lcore(lcore_id) < 0) rte_exit(EXIT_FAILURE, "failed to wait\n"); -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-09 11:57:45.514214973 +0100 +++ 0041-app-pdump-abort-on-multi-core-capture-limit.patch 2022-03-09 11:57:43.420938557 +0100 @@ -1 +1 @@ -From 3ee04ebc91f3872c4c1d9f9911f0cdfa32377d8c Mon Sep 17 00:00:00 2001 +From e980bd3f16782be650fa286adedefc3644bc35e4 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 3ee04ebc91f3872c4c1d9f9911f0cdfa32377d8c ] + @@ -12 +13,0 @@ -Cc: stable@dpdk.org @@ -21 +22 @@ -index 04a38e8911..96fa76f8da 100644 +index c38c53719e..99ef010d13 100644 @@ -24 +25 @@ -@@ -900,11 +900,21 @@ dump_packets_core(void *arg) +@@ -906,11 +906,21 @@ dump_packets_core(void *arg) @@ -47 +48 @@ -@@ -930,12 +940,12 @@ dump_packets(void) +@@ -936,12 +946,12 @@ dump_packets(void)