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 A9C644624E for ; Mon, 17 Feb 2025 18:08:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C8F9400EF; Mon, 17 Feb 2025 18:08:40 +0100 (CET) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id 38F2A402DF for ; Mon, 17 Feb 2025 18:08:39 +0100 (CET) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-43948f77f1aso29983405e9.0 for ; Mon, 17 Feb 2025 09:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739812119; x=1740416919; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Hqp6yIUEBqrx0OtDfaiB8bOAtzTI4Q7Ib6ly+2K6V9U=; b=cSdZRBddS9c5pMNYcndm9DWHG+OtdloV8YQwhMlswBk3M6j8sB1dB5Kk5Vvx1FZrvL VX9lLIWOZ5SpN7YIjgz8LRzJFKoxY6JN3QCKaxW4ub57nROFPNL/d+iYzzJuyQdSeQtU AAGbER4n60i6Ck2lidATpllv7cpeQ65yjgQVhdh6VhBCh9qbvXIzsf+XFzuiYxYKne0+ 74hew7Gh0x5wefkr75XwgEHsNBjqmVZ7y5jpRbTlgn8v2zyEs4rA/q+QCQg+S1HrYO5I WGpq/fq2ZvguVFk3lNd8NkgEkTqhP4GZOxHwoxOi0eOT+n4+Q6x5sh6TyfCeJjqT1T2H 3u0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739812119; x=1740416919; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hqp6yIUEBqrx0OtDfaiB8bOAtzTI4Q7Ib6ly+2K6V9U=; b=gKmRGR2bA1HPW6FgyD2G7sYABf/6/8k/k7a6Cv84VcSEv4+tHnQLqmV6n+PVIMyw8W 1BsQA+Qvinf8SHNLPlT49OrIyEO7i+sZzA8otsTNa0Cf/g3twbhytSGxBYFOkdlY77Nj /7Fdg8EokJpJgrAu65MVQ8ljHPRmGQZ29RRmHxOSVf44tq8mORN8ZtcuJ2x/NEwRgmM5 mhVuW+4FwyPDYuQULBCwLrPTKYymvcj9kjjxTVlqazDqP38bj8Kawc0okpOETUyGkxxC XCb4PcUKBqx3cIC/GfZyM9giybhKgyW5pjy0+/dOUI8Ek5PMU5UXc4I2pcSUWG2gQXc3 ZLXA== X-Forwarded-Encrypted: i=1; AJvYcCW+xaNEAOYPG3+q22XGHM2QVOkQkrBC3pkOskYiaRbE6PvI/hz1Ps8+/ZguuRx7KHw+n3tVNn8=@dpdk.org X-Gm-Message-State: AOJu0Yz4YzNgI9UUz2Jz9JCqTufGDcAegvaSJ1zzSLYoMi7+j+l35eU0 r6ZDOWDoM72ByZccOTphqGGV/x15KLTWcuqVkPBiaryG2mBCRJul X-Gm-Gg: ASbGncsA9Qw8qHxzKOwsmWOXR0NJSIfMdMrCG0uzaJnF6denhTCpdWVc++MFbeRnRo2 Rjy88XyKAzRTm16LqDls1cSmPZnQSaXUgOr22nM38u29oJg0RKs9UbQhqZoCrE/2uaVKS/uIjvZ hcs1iKDZZmar+32raHmXdEYQQmXSqHbkk0MfO5UaKhY/Np4qlVinKLMcmuyv+PaIV5BaVG7inb9 FjNK9i5BGTQW6iyVXOIcxKo5p0Ukvvv0yqQb/AR0DgMAwHkRAidt22TkwLuE96XJTOVm5/143cS unyrQQwRUD/uwssfoUIEPw== X-Google-Smtp-Source: AGHT+IFC7+7x1hyEFdKZlFsL7WVHurjwAqp9hIaqOZ9uePF64CVdFaWt+PAVOMxVcPoZVqJXz7FDUw== X-Received: by 2002:a05:6000:1569:b0:38f:5057:5810 with SMTP id ffacd0b85a97d-38f50575957mr102459f8f.25.1739812118682; Mon, 17 Feb 2025 09:08:38 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:f83c:95e7:29fd:a997]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-38f258b43d4sm12565975f8f.4.2025.02.17.09.08.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2025 09:08:38 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Hemant Agrawal , dpdk stable Subject: patch 'crypto/dpaa_sec: fix bitmask truncation' has been queued to stable release 22.11.8 Date: Mon, 17 Feb 2025 17:04:43 +0000 Message-ID: <20250217170456.1068278-70-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250217170456.1068278-1-luca.boccassi@gmail.com> References: <20250217170456.1068278-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 22.11.8 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/19/25. 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/32a4ef73f2cab1a50dbb503d41cf85359e905316 Thanks. Luca Boccassi --- >From 32a4ef73f2cab1a50dbb503d41cf85359e905316 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 5 Feb 2025 08:23:14 -0800 Subject: [PATCH] crypto/dpaa_sec: fix bitmask truncation [ upstream commit 7c18f573c1f5368f70e6e956c4ba0c6f97b19cb1 ] The dqrr_held mask is 64 bit but updates were getting truncated because 1 is of type int (32 bit) and the result shift of int is of type int (32 bit); therefore any value >= 32 would get truncated. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: fe3688ba7950 ("crypto/dpaa_sec: support event crypto adapter") Signed-off-by: Stephen Hemminger Acked-by: Hemant Agrawal --- drivers/crypto/dpaa_sec/dpaa_sec.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 8687e3e75e..05e543f955 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -1910,13 +1910,12 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, op = *(ops++); if (*dpaa_seqn(op->sym->m_src) != 0) { index = *dpaa_seqn(op->sym->m_src) - 1; - if (DPAA_PER_LCORE_DQRR_HELD & (1 << index)) { + if (DPAA_PER_LCORE_DQRR_HELD & (UINT64_C(1) << index)) { /* QM_EQCR_DCA_IDXMASK = 0x0f */ flags[loop] = ((index & 0x0f) << 8); flags[loop] |= QMAN_ENQUEUE_FLAG_DCA; DPAA_PER_LCORE_DQRR_SIZE--; - DPAA_PER_LCORE_DQRR_HELD &= - ~(1 << index); + DPAA_PER_LCORE_DQRR_HELD &= ~(UINT64_C(1) << index); } } @@ -3451,7 +3450,7 @@ dpaa_sec_process_atomic_event(void *event, /* Save active dqrr entries */ index = ((uintptr_t)dqrr >> 6) & (16/*QM_DQRR_SIZE*/ - 1); DPAA_PER_LCORE_DQRR_SIZE++; - DPAA_PER_LCORE_DQRR_HELD |= 1 << index; + DPAA_PER_LCORE_DQRR_HELD |= UINT64_C(1) << index; DPAA_PER_LCORE_DQRR_MBUF(index) = ctx->op->sym->m_src; ev->impl_opaque = index + 1; *dpaa_seqn(ctx->op->sym->m_src) = (uint32_t)index + 1; -- 2.47.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2025-02-17 16:13:19.304229620 +0000 +++ 0070-crypto-dpaa_sec-fix-bitmask-truncation.patch 2025-02-17 16:13:16.866441592 +0000 @@ -1 +1 @@ -From 7c18f573c1f5368f70e6e956c4ba0c6f97b19cb1 Mon Sep 17 00:00:00 2001 +From 32a4ef73f2cab1a50dbb503d41cf85359e905316 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 7c18f573c1f5368f70e6e956c4ba0c6f97b19cb1 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -22 +23 @@ -index 3fa88ca968..e117cd77a6 100644 +index 8687e3e75e..05e543f955 100644 @@ -25 +26 @@ -@@ -1907,13 +1907,12 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, +@@ -1910,13 +1910,12 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, @@ -41 +42 @@ -@@ -3500,7 +3499,7 @@ dpaa_sec_process_atomic_event(void *event, +@@ -3451,7 +3450,7 @@ dpaa_sec_process_atomic_event(void *event,