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 BFAD5A0C41 for ; Tue, 30 Nov 2021 17:38:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA55C411ED; Tue, 30 Nov 2021 17:38:09 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id A718B411E6 for ; Tue, 30 Nov 2021 17:38:08 +0100 (CET) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (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-0.canonical.com (Postfix) with ESMTPS id 5403C3F1B2 for ; Tue, 30 Nov 2021 16:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638290288; bh=WNlstZwplUbLX2hkJlUrri7gbbOsCvCuH5571RM+rac=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gvfkVRohFA6Hx52YfaWWNQ0GTdRLgc9GNPLSA46Ax5krr1UHEfwvXLErYjF3G9woz b+r/RD2NJkXlYqypQnrjvqbuAZN3hzv43bkn3IuLtAoUvJGIXhdJZhwLX/8oK4GgEN /jsgYnu+XkzfOoQ9JRSSePGzWBmkX76fyxJRIlGsSaG8HVwEiidjMoDy3reejSjilE xxH2jN6+sLgDvR6wUHzwh/HuSMTpZVmvA9OjLQxT0JFCZYzdLANpR+eN4yL0YVZp4r i5SfEQwbZh6JReG7SbydcJcGh/Pj9EBG5gtyaNuax5aiUij5lnZdNjnQytZANdO0Cc BN2VQkJnKeHPg== Received: by mail-ed1-f71.google.com with SMTP id v10-20020aa7d9ca000000b003e7bed57968so17403783eds.23 for ; Tue, 30 Nov 2021 08:38:08 -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=WNlstZwplUbLX2hkJlUrri7gbbOsCvCuH5571RM+rac=; b=XgOAgB0Hbt12CY78cWLnIOEzCkQx10wZyIABb2jCfTiLvJ46zlqEmwg8oPEneUT8sT d1r9NaEVoORPYW51bTJUfdgABEfzz5XoNvbgMJZAnMAzX8Ut2iJ9nCyBHIP7MTd+Re0c 9eLM45eoILxzIcwREQiaSXkO4AQC9KaMddt8R7uY5bYWvNDk0TtU4NVaEXN8k/2Iaval UNPeFPxnsxJQpAl7zvq8xTbdg1/k2Hp7cFIqpKxAZumYZfESLw84AsNi6v1mySV7Gz1Z N3pAsGtqQTB3V41Xl1/I4B9cd6HOFdCC5vJFC3BGqTfeUsN5JK3js35zglJvMQ0fQaVc e7zQ== X-Gm-Message-State: AOAM533OwUvwK8niEpT8S0LHqawpuJ1k60kvxFS3d7MlLvD+5Uelj6Lm GAkyxI78niFAKEhzzpG56uij4nSGHxCEJYj0I04ZdvyDvSYZXcEaZGXwwyevF3fFXYh6SOkcuDI maJ010CUWuQx1zv7m8M1jKNkT X-Received: by 2002:a05:6402:2c4:: with SMTP id b4mr10735edx.265.1638290287997; Tue, 30 Nov 2021 08:38:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqkrLSMUQy47XutowzXh+nElI2/t60tCDldDlt3H6O9Bn5MAWD/Jq9eDPgjT2+xBNcJh6weg== X-Received: by 2002:a05:6402:2c4:: with SMTP id b4mr10709edx.265.1638290287794; Tue, 30 Nov 2021 08:38:07 -0800 (PST) Received: from localhost.localdomain ([2001:67c:1560:8007::aac:c4ad]) by smtp.gmail.com with ESMTPSA id gt18sm9745641ejc.46.2021.11.30.08.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Nov 2021 08:38:07 -0800 (PST) From: christian.ehrhardt@canonical.com To: Rebecca Troy Cc: Fan Zhang , dpdk stable Subject: patch 'test/compress: fix buffer overflow' has been queued to stable release 19.11.11 Date: Tue, 30 Nov 2021 17:34:03 +0100 Message-Id: <20211130163605.2460997-39-christian.ehrhardt@canonical.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211130163605.2460997-1-christian.ehrhardt@canonical.com> References: <20211130163605.2460997-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.11 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before December 10th 2021. 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/9228c06157107faf11dac32d1dba7f268bf73d2e Thanks. Christian Ehrhardt --- >From 9228c06157107faf11dac32d1dba7f268bf73d2e Mon Sep 17 00:00:00 2001 From: Rebecca Troy Date: Fri, 17 Sep 2021 15:12:07 +0000 Subject: [PATCH] test/compress: fix buffer overflow [ upstream commit 96fe84f42a361382b89f462873edae7c1236c303 ] Fixes stack buffer overflow bug in compressdev autotest, which was caused by the use of buf_idx in the debug logs. Originally, buf_idx was treated as an array instead of the reference of an integer. This was fixed by replacing the use of buf_idx[priv_data->orig_idx] with the variable i. Fixes: 466a2c4bb5f4 ("test/compress: improve debug logs") Fixes: 6bbc5a923625 ("test/compress: refactor unit tests") Signed-off-by: Rebecca Troy Acked-by: Fan Zhang --- app/test/test_compressdev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c index 7549135c25..310f37cfa0 100644 --- a/app/test/test_compressdev.c +++ b/app/test/test_compressdev.c @@ -1359,7 +1359,6 @@ test_deflate_comp_finalize(const struct interim_data_params *int_data, /* from int_data: */ unsigned int num_xforms = int_data->num_xforms; struct rte_comp_xform **compress_xforms = int_data->compress_xforms; - uint16_t *buf_idx = int_data->buf_idx; unsigned int num_bufs = int_data->num_bufs; /* from test_priv_data: */ @@ -1390,7 +1389,7 @@ test_deflate_comp_finalize(const struct interim_data_params *int_data, RTE_LOG(DEBUG, USER1, "Buffer %u compressed by %s from %u to" " %u bytes (level = %d, huffman = %s)\n", - buf_idx[priv_data->orig_idx], engine, + i, engine, ops_processed[i]->consumed, ops_processed[i]->produced, compress_xform->level, huffman_type_strings[huffman_type]); @@ -1681,7 +1680,6 @@ test_deflate_decomp_finalize(const struct interim_data_params *int_data, static unsigned int step; /* from int_data: */ - uint16_t *buf_idx = int_data->buf_idx; unsigned int num_bufs = int_data->num_bufs; const char * const *test_bufs = int_data->test_bufs; struct rte_comp_xform **compress_xforms = int_data->compress_xforms; @@ -1713,7 +1711,7 @@ test_deflate_decomp_finalize(const struct interim_data_params *int_data, strlcpy(engine, "pmd", sizeof(engine)); RTE_LOG(DEBUG, USER1, "Buffer %u decompressed by %s from %u to %u bytes\n", - buf_idx[priv_data->orig_idx], engine, + i, engine, ops_processed[i]->consumed, ops_processed[i]->produced); ops[i] = NULL; } -- 2.34.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-30 16:50:08.348877905 +0100 +++ 0039-test-compress-fix-buffer-overflow.patch 2021-11-30 16:50:05.650872502 +0100 @@ -1 +1 @@ -From 96fe84f42a361382b89f462873edae7c1236c303 Mon Sep 17 00:00:00 2001 +From 9228c06157107faf11dac32d1dba7f268bf73d2e Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 96fe84f42a361382b89f462873edae7c1236c303 ] + @@ -14 +15,0 @@ -Cc: stable@dpdk.org @@ -23 +24 @@ -index 0571c17ecb..a1b9f06250 100644 +index 7549135c25..310f37cfa0 100644 @@ -26 +27 @@ -@@ -1411,7 +1411,6 @@ test_deflate_comp_finalize(const struct interim_data_params *int_data, +@@ -1359,7 +1359,6 @@ test_deflate_comp_finalize(const struct interim_data_params *int_data, @@ -34 +35 @@ -@@ -1442,7 +1441,7 @@ test_deflate_comp_finalize(const struct interim_data_params *int_data, +@@ -1390,7 +1389,7 @@ test_deflate_comp_finalize(const struct interim_data_params *int_data, @@ -43 +44 @@ -@@ -1734,7 +1733,6 @@ test_deflate_decomp_finalize(const struct interim_data_params *int_data, +@@ -1681,7 +1680,6 @@ test_deflate_decomp_finalize(const struct interim_data_params *int_data, @@ -51 +52 @@ -@@ -1766,7 +1764,7 @@ test_deflate_decomp_finalize(const struct interim_data_params *int_data, +@@ -1713,7 +1711,7 @@ test_deflate_decomp_finalize(const struct interim_data_params *int_data,