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 D75F7A034F for ; Wed, 10 Nov 2021 07:40:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAAC840142; Wed, 10 Nov 2021 07:40:15 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by mails.dpdk.org (Postfix) with ESMTP id 1754340142 for ; Wed, 10 Nov 2021 07:40:14 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PRgBbSBDdomLYW7tGxFJ4qBbmxJbiGgyxlrkoU6XmmzT5aUiaX2QD7jd1Isbv2Lyn4KBLWvJkgf0f+SwLQkzMr6kus5O5t0V7aQHFooWPWvOTHe8015iBPNfX/61asW541xUt/gW+VYBNNxF49WpEmwHokCVnTNriXbM87bcUHhHy9oNyMdC2v6I8PwTb7Ewn3tTQ4oPfLMUYDWS36z7k3Hr3anopLdsZlxhShK2AhJUnM4pDA1+CyUuKOxx0hNhpMbbnjwshsmF6A0+JzDs9oZtw6Ud6KjZrPd7T7Uq7D/xmzOuTynCSbVhEeGDxjKrkrZn5ExHhKBQbja5sdEo1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=niYxrKyiZFmv0dW0/Zv76w8vJyyXNaQQoui4iVUp+0E=; b=n5Zo6gwxfv+lIJWcGtf1fCNvxGXukVnM9dEhlSu2W0t8HXPTaoHsrG9pBA8Nf4fXW/FyVRvcAngpKSEdMvsXov5TLg4iQ1OIQn7f9DMh+elsE93qFAu1EKQvVDGlShRMQLNS3FWCBHZg/M17i848tayeWRZDrjsOR5I+omF68QihUfo4lfnR88Qw/2GyVZWyIo405a+wHoE7fheIqraLDXBoNJJKIvoL+6cyk4a3mx2yLjKc2EfNo39/HU3mw74p2AQXNWHest6fxZS5qWj8mBlKwo5XIHF+9g42z7YmhzF9XgZUMtGpKvtiITHBx1LGIPkgUcYbmCTq1hVosTjgKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=niYxrKyiZFmv0dW0/Zv76w8vJyyXNaQQoui4iVUp+0E=; b=uHAMb7waTJblHwMwGNAijOp65/Znw5El1lDvPTMSTxGPOCXxTCy7t+7NTRpYncxmORFcRQuf0jqhzMsAGmVhH+3nh6a5+N4PNKW6rrWHyBcf5NvXkW4FUT3fop0hAn6aAxOciHVwjwOJ0786tDrD67+ATAvlUiwk6uppcopErApqrkyuiui7Hu3d2VEhBzxfW7hmj8v7/BKRI7v5i+q37qdOCHV2bjux3BiZbZ6wgtLrCz8REmqMRugUkkg5hLMh+ikoYH5l2VUgyTNPR0pCaH3kcFeCwZeu1iGAIRo+u2cYtLOhoLaO857wnIjGLlos+WEY9LiqsVIekIe8CBUqWQ== Received: from DM6PR02CA0079.namprd02.prod.outlook.com (2603:10b6:5:1f4::20) by BN8PR12MB2963.namprd12.prod.outlook.com (2603:10b6:408:61::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 06:40:12 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1f4:cafe::52) by DM6PR02CA0079.outlook.office365.com (2603:10b6:5:1f4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:40:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 06:40:11 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 10 Nov 2021 06:40:09 +0000 From: Xueming Li To: Rebecca Troy CC: Luca Boccassi , Fan Zhang , dpdk stable Date: Wed, 10 Nov 2021 14:29:14 +0800 Message-ID: <20211110063216.2744012-71-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211110063216.2744012-1-xuemingl@nvidia.com> References: <20211110063216.2744012-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6d3940c-6c44-4905-0bd8-08d9a414f20b X-MS-TrafficTypeDiagnostic: BN8PR12MB2963: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0W7U4zjbJwOqF7/UOiybEHaUVpS7BnfoNYXr4malaytmwGtKMW9O2fOTk+mtBXlol+wv0RFhyPIe5HPl2j0m0eESis//2FEDVAmm5dlkpvmFUbSWKT1nhzgjW3Cesh6ZhTbCfQ+9g3ZWXUnF32PIBe3PH68lFDG1a7qvLKoCWw4ExeeYDwOL7z+Os5IAghi3emnJCCQRmqVonhp0Lc4VQORpGdt/HTItmEbOc9wo4Cu6wsRuSqyAkhsDEmL5CGEkU+EBtfg8ZfwTlzZ1ltHtgH4J5I1OPHx77dWaQV2NJ6jMoO2CNjfk+IzaF9B/3R4mOcbIENk/NqYqJ4dxmwTPxi0dx44QWgezPz0n2fsQgKqg/lhKjhz5kLck+icsa4aApBzSXCNT4a1P6jIZqXvQIqQfgBs2m70+9GP6ydLFL5TyAeJPpQt+k+O4m8eM0kW+JivQEl2lZSbKA8mGiPjpIs/QjeyACMdMLjGNmNY87NQNSPiT1F3SC5VzybZVKB9YcmZu33WBMQ0uj2B6AgoiMqhW+N5kleP3Y8ogsKiAcaw6If2nglULkRth5qHU+7lE11YFyLo4j486ndtb0oZ4pOxrWZU/jmYNQkl2Aj/gfJ1yLAPtIo66U+UOca5/qSCFqYpN0+d9HNiBAhezJOkKbEfbkutfN4ym/Z3tLF6eBDvn2yqw/XnEvEMV9iRxAsrwZ/xRM/Bir0OtsuMjCq83P0cMco5lPy56yQQPwsPmQRtlt/kFrsyAncdLQpKrfcx5EfJC/JF75ZYIeY6KhqHnZna+L5v51gAJV1eOEqtb5QpPrQGdUholm0C8MsNHiGEAskWmbeMimhuVjtBcQu+HXg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(4326008)(5660300002)(508600001)(16526019)(6916009)(186003)(426003)(316002)(26005)(6286002)(336012)(966005)(4001150100001)(53546011)(70206006)(8676002)(7696005)(86362001)(47076005)(70586007)(8936002)(7636003)(36756003)(36860700001)(55016002)(356005)(2906002)(54906003)(83380400001)(82310400003)(6666004)(2616005)(1076003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 06:40:11.5497 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6d3940c-6c44-4905-0bd8-08d9a414f20b X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2963 Subject: [dpdk-stable] patch 'test/compress: fix buffer overflow' has been queued to stable release 20.11.4 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" Hi, FYI, your patch has been queued to stable release 20.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/12/21. 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/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/25533b38a694b9fee04712a766b56014f5c84161 Thanks. Xueming Li --- >From 25533b38a694b9fee04712a766b56014f5c84161 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 Cc: Xueming Li [ 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 0571c17ecb..a1b9f06250 100644 --- a/app/test/test_compressdev.c +++ b/app/test/test_compressdev.c @@ -1411,7 +1411,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: */ @@ -1442,7 +1441,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]); @@ -1734,7 +1733,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; @@ -1766,7 +1764,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.33.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-11-10 14:17:05.181382630 +0800 +++ 0070-test-compress-fix-buffer-overflow.patch 2021-11-10 14:17:01.827413112 +0800 @@ -1 +1 @@ -From 96fe84f42a361382b89f462873edae7c1236c303 Mon Sep 17 00:00:00 2001 +From 25533b38a694b9fee04712a766b56014f5c84161 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 96fe84f42a361382b89f462873edae7c1236c303 ] @@ -14 +16,0 @@ -Cc: stable@dpdk.org