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 859B145D30; Mon, 18 Nov 2024 08:03:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7771440DD2; Mon, 18 Nov 2024 08:03:58 +0100 (CET) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazon11013030.outbound.protection.outlook.com [52.101.67.30]) by mails.dpdk.org (Postfix) with ESMTP id C9BE24065C; Mon, 18 Nov 2024 08:03:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dyKC+rG7xZj9LQqzPWvCjtyGS/e8dwq+1duMsRJHzN8eD0cSIk9phPxg7e+x2Fnq07tiEqPHAuyvQcZ4U4iG/sV1dlRKZmVNrIJj+DBBEXEdrysmZfc0UC8xGK3DSENXyKF44oywe3TVGdbaDUl1ahAXRRfx65940mIiFogop36YQ9uTK1HoISo4f6czkJ6QudmkOx+OP1hwazJnAhbkKGWzsjaIa4aGeqWAz/l1CdCuFqidL7gYHJFfA2AWnPAV4Uq5LW1awUaZwLtjUSLDEHUtILqguBkXuXlBGeucd7lO7AdQ6f60xyU5dRc6lGowoT4QzJm/HlGzuap0j8/ovQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=OyFFYnTk2MPHVKMN1e5J6l5U/ORxbhppZBLhi2XtMVY=; b=VyJqvVnwiCvvpqrervU2jA9f7sVWr2KsFeM/f7iMjcaHEGEfETjKaCKdDfNxkgfaHJl3LBUoerZq0CG41U4vJphu8tyMc/BazOEM0TVxdWeU9v3nHmEcho02PBJyZ1MWdaBn5nnfW38OYb1RcNgV1DYKjacvzYizrQeq2SWnC8+XUUXMR427uHDgD+1+9seFLpEWDxVjsJ0xUZyQc+HMI9GKLTYWcD8Jc6c2MVEIwT01exKqDx/8znPd1imWYjIXpzqYXar1AemeS6eMUAEFvsClhcMBe2lEKyM1LsbKDQGtDYO/K/FuGuN/cwS5r0P4PnPORodEsBCqo0IuGs56HQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OyFFYnTk2MPHVKMN1e5J6l5U/ORxbhppZBLhi2XtMVY=; b=NqRUwleLto1ztdNJyiWGQLG9nA5SuldEt5y7qKtP3weuP0O91Dldx/bumh4ho8ZP4QeG57/skSRkIzg+myXdknpZ5QKWggXxFf9Hm3xPUk27r2lDtnA1ZJ/V2a2rb8scxWgHnHI02k2B0+n5iXmbccvcqf/uuTJ0R3ZRMw70JEoLakhOAtlHI6JWfyE6+Z+8o9OsO4TWx6Z+U4Ahlo9M2/gKaHIH7SdcfZka0pF3fW6iSYG9kG0xHu9a99M+wpLs6Hv6UgVDeieR2A2AwDI1BAvLkebC5e1b+c581XAO3C9DYzNoRcJj8ST7vvAvJH0vm9Sdx3LQNj1dTvim6eBAAQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by AS4PR04MB9690.eurprd04.prod.outlook.com (2603:10a6:20b:4fd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Mon, 18 Nov 2024 07:03:55 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%5]) with mapi id 15.20.8158.019; Mon, 18 Nov 2024 07:03:55 +0000 Message-ID: <2dd9ae7f-d8b2-6b48-485a-1efe7683c249@oss.nxp.com> Date: Mon, 18 Nov 2024 12:33:46 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH 13/16] crypto/dpaa_sec: fix bitmask truncation Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: akhil.goyal@nxp.com, stable@dpdk.org, Gagandeep Singh , Hemant Agrawal , Akhil Goyal References: <20241115060738.313190-1-stephen@networkplumber.org> <20241115060738.313190-14-stephen@networkplumber.org> From: Hemant Agrawal In-Reply-To: <20241115060738.313190-14-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SG2PR04CA0160.apcprd04.prod.outlook.com (2603:1096:4::22) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AS4PR04MB9690:EE_ X-MS-Office365-Filtering-Correlation-Id: 0460e7dd-1286-4687-fd19-08dd079f2ad0 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: =?utf-8?B?bTdUdlRXNFU4dGtSSi9leGh0KzRLakJ5dW9GUklwUlRTTWNIcnhGOHk3Zzk1?= =?utf-8?B?NjBhOWNUMkFBNS96OS8xeXJqWnRl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HU1dlNETjg0dnZMak5uNlRPWDBIMk1tSEU2S1RqT0RKR21T?= =?utf-8?B?elEzaXhXZFlRcUxyd3RvNE9reTVFazJNVDJFVkx6bUhzMEZRbStySmZPdkoy?= =?utf-8?B?NzZkS3N0ZURjRnNCcUQyNDd4clF2MEpVaEdwTDRKeHVLa1VkQ3R1c2prUVVl?= =?utf-8?B?cW5HM0ZvNkZVUCtCVVQwQUhBa1BpUktRTWxSbDQwZ215d01HOWg3VXYyVFBm?= =?utf-8?B?NzFGb2ZPSGJtZjVBbDdZRXgrMVA2dEpkM05vNGk1RXRER3pRaDFHVTJTYjVO?= =?utf-8?B?dGd2QXdJYkY5eEp3dHhKYzQvRHUwZUEvY2NNVWhmMmw4bndxV29VUXJKRjM1?= =?utf-8?B?aWVhbGRrdEp5Y01QK3BEQ0gyMEs4TmI0SUE2NmpCR0xyOWhLZmNUVGVXMzFz?= =?utf-8?B?YXg4Q3daZUM3TE1mUlFYL1ZmdVhid3VyTDZ0QTVWNGZRekUzOWFQN3pHL1l1?= =?utf-8?B?Z0k3aTdabWY1WHFNbm9vWDMyanhvcGtXM2ZqbWFQNUhpQkI3S09JNDNtQ3R2?= =?utf-8?B?R1d1Z2hscGVxRDR1NUlJWTRWT3NjWXZ6WEU0bmFic1NhWGxTQ3NKdWs0MUtl?= =?utf-8?B?Yi9ZdWpRVTdrTEZ3TDR3cHZyK0ZMUkxSVTk4QnN3ZmU5ZHNNclRYcGNSTkFk?= =?utf-8?B?cTNGL2lDcDJ3TVU1WnJFTnYzWlZWcUhtR1czclRPcGxsalgzRmNtVTZhTVUy?= =?utf-8?Q?UStdGyyg7cUFeso5kYyh?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkC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?utf-8?B?ZU1qdlNOeFBFRUU2SnRKMVFvWHdJc0Q2bWk3QmlNNVV2ckdZVGk4YytSRXEy?= =?utf-8?B?Q1orTFNxTEdPRU5nb0tYeTBKZCtFLy84ZWZjekU3aDlPTVNlb3Blc2lBSHlK?= =?utf-8?B?UUV6ZUl5cGsxYU1nUUR1QjVTb3VlVkhtZk05c3dYTHlmdEMxbndHSjA1anAr?= =?utf-8?B?Ky9qbHMwOXJMYUNvcm9RYnRxL3poZ0RHTndMZmF6Q3FhR3hxUk4reGFYWjVl?= =?utf-8?B?bThzL0ovQ1ptaE42UnNhUG9JeE1xQ0d1eDNzQzBFcndvUzdrOWI1ZE4xVVov?= =?utf-8?B?Q0lXei9pRVpWbWxBUXk5UVdnek9KWUVhREtDU1RQa01sbVRjcTY1UlY3anR1?= =?utf-8?B?bmsrUUtSNnFRaFNpbmJKR3lzWVNuYytBbk1IWlVVaTN3alRiRWVsUDlwU01Z?= =?utf-8?B?K3c9PQ==?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0460e7dd-1286-4687-fd19-08dd079f2ad0 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 07:03:55.8789 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C9OExbNUBBrRniWw+bsL2dwp5t13IppIgnvEON7ZDLY/rmPh/Wt7oxYY54IoSKysVP1dTn2v295LDFPD+0d5pQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9690 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 15-11-2024 11:35, Stephen Hemminger wrote: > 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") > Cc: akhil.goyal@nxp.com > Cc: stable@dpdk.org > > Signed-off-by: Stephen Hemminger > --- > 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 3fa88ca968..e117cd77a6 100644 > --- a/drivers/crypto/dpaa_sec/dpaa_sec.c > +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c > @@ -1907,13 +1907,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); > } > } > > @@ -3500,7 +3499,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; Acked-by: Hemant Agrawal