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 CF27EA0351 for ; Mon, 21 Feb 2022 19:07:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA0CC410F3; Mon, 21 Feb 2022 19:07:16 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 68E554013F; Mon, 21 Feb 2022 19:07:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645466834; x=1677002834; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=izgJz/8zZ6fJJk56OQn9KKeeD0O9OXKD54mhJeAqiJg=; b=G2dF0+t992EUx14Mhcwn/wi/XRuzPJpAsZSr5CkxQ3L9HrCgI4NvkGi8 z1yrtcgyN3d9tdZtkhA+UnkG9Drkw8QiHZ0U0AAsXKm14ggw4nqgL0oPP d/mCX10E0aZaAonLqoMpy2M6JcylDjcKUUTGtcZhjw9Z3ybgpFuLMpbm7 OuIRgwI2QoTXe2WmTAJz4dPY+DxBlCvqhKZd2R795KBB+jofmK8dvbLMu HLQNuj/oDtU+UJdTaupuJ8g2B2BqDEODxtFAK3udLHXEAoiogJ1i+Krcv iNZ8cmLJOSUWflPUKf+r6akMSnDbBsNUhW2wuHY0d1+byhRBDn3eEbaF3 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10265"; a="250372580" X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="250372580" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Feb 2022 10:07:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,386,1635231600"; d="scan'208";a="683270740" Received: from unknown (HELO silpixa00400883.ir.intel.com) ([10.243.23.143]) by fmsmga001.fm.intel.com with ESMTP; 21 Feb 2022 10:07:11 -0800 From: Brian Dooley To: dev@dpdk.org Cc: Brian Dooley , declan.doherty@intel.com, stable@dpdk.org, Akhil Goyal , Fan Zhang , Sergio Gonzalez Monroy Subject: [PATCH] examples/l2fwd-crypto: fix potential overflow Date: Mon, 21 Feb 2022 18:06:58 +0000 Message-Id: <20220221180658.440683-1-brian.dooley@intel.com> X-Mailer: git-send-email 2.25.1 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 Coverity flags an issue with 32-bit value. If max ethports value is configured with a value larger than 32 there will be an issue. Coverity issue: 375863 Unintentional integer overflow Fixes: 387259bd6c67 ("examples/l2fwd-crypto: add sample application") Cc: declan.doherty@intel.com Cc: stable@dpdk.org Signed-off-by: Brian Dooley --- examples/l2fwd-crypto/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index 4d9f8861af..bbdb263143 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -2719,7 +2719,7 @@ initialize_ports(struct l2fwd_crypto_options *options) last_portid = portid; } - l2fwd_enabled_port_mask |= (1 << portid); + l2fwd_enabled_port_mask |= (1ULL << portid); enabled_portcount++; } -- 2.25.1