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 DB174454AC for ; Thu, 20 Jun 2024 18:33:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CAEFD42E5A; Thu, 20 Jun 2024 18:33:41 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by mails.dpdk.org (Postfix) with ESMTP id 1935740647; Thu, 20 Jun 2024 18:33:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718901219; x=1750437219; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Jv6SNAai7xh4VLWD+Tn7oFwKnocgr7CfLWUDMxlI170=; b=l2irNdXIvjGgTTZR/jw5cLyvjb7ob3rg1DWSBrqBoTL/hCl62jnMi4rp 16zOUYQTuxGX345eglxz31+Xj0bq5aTF8pQoi3xcbF6Hc+NsGWNMQ5jij SCwmGTDLsXSxKs67TlUDm7we/K1UWt5geuNXjeYV+dSduyPBpsoOJ5Fm7 AUGoEuX86pFXNLe8ruKWl9qMCCWMV3+YA+6bMWMfLRHEIgehvaU5cf13R lJJiWh9rcWIX6c1eqILX9SbP9w1QDqHOEDB7PLrTcUWgQPQ4ZkQPJdEIl mrF9f9Jjd7+7o+8qTMnrhOc5HuOkpfNA5t8loPEg1j7+k0jzIhwWdBVWA w==; X-CSE-ConnectionGUID: R+0IePtGQEe7WDw3MqVyOg== X-CSE-MsgGUID: +6A6Avs9QFmULWP2bt83Rg== X-IronPort-AV: E=McAfee;i="6700,10204,11109"; a="33358906" X-IronPort-AV: E=Sophos;i="6.08,252,1712646000"; d="scan'208";a="33358906" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jun 2024 09:33:38 -0700 X-CSE-ConnectionGUID: S4TIyTR3TPeVIVeQjB5KVA== X-CSE-MsgGUID: g0zrUu5MTgCNOkBGq8Gl9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,252,1712646000"; d="scan'208";a="65551046" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmviesa002.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Jun 2024 09:33:37 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 20 Jun 2024 09:33:36 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Thu, 20 Jun 2024 09:33:36 -0700 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 20 Jun 2024 09:33:36 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cf+KuYmLr0kERCJ8w+iPfhWDWVXaGmBkAieSlSxUg8rHXF7OP1NuTYMZqToxzdfBXDKqX+oxEC678gcdfx/qUEsgzsV6PivKK3U1rhylv6RJlopSn+SugM1m2bs1pytUi4fwiM5PIJ27DFzEKugkFSfsBjrVCxKE9BbagoV5VHJ8nhme3+F7RBBmflDTXOyT5wknm8HlYF1xdkq/l3iOCM26Ob7t++Tg754fyETPZu9XqxCVSZBeMh2lgVFG+YfnbTwdG6PL/bfY4PuBzybhpyX22Oz6kAxX5QQLCaXnLCtuAZ7RjboUwxXoyLq++qre2cMXhSmJdHiD1SIEGr7q1Q== 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=wCt2hQoplIJn/bVzvNLey0UHS8lrNCNEAK2pLrjRNaw=; b=OkFw6B+yJ/5FrFt2P2OfQAG8FewxwKI5yXiuvCp601I1PNfe+0/Q7OqynSb3fqTOCVbTYwquredup17NZKoSFSfjqaBlOscHNwRCPumUXqoYo0sWJGq3GHrmq6li1JhGsZtvaf0gPQ4igPcO7poBHeJ+1VaHGJWE+1KxFujJfvDTQ4fTB8e9+Hh4Y1Fyr5kpPxQThkwERRQ5OHQGXC6Cy04O7CqR0JEPCg0HzIxlQphiPNV8epLs5q6hWs0S/oxvbB1+lpr3WbMbsIBIBvpoK0b+7E0ZO9PEzNma8NokWKE2FJ57XAPz58U4eQKGI/Mcls7UqZFvWJQbMlCTz0AmZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SJ0PR11MB5056.namprd11.prod.outlook.com (2603:10b6:a03:2d5::6) by DS0PR11MB8181.namprd11.prod.outlook.com (2603:10b6:8:159::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.20; Thu, 20 Jun 2024 16:33:34 +0000 Received: from SJ0PR11MB5056.namprd11.prod.outlook.com ([fe80::4f35:279e:a725:ad08]) by SJ0PR11MB5056.namprd11.prod.outlook.com ([fe80::4f35:279e:a725:ad08%6]) with mapi id 15.20.7698.020; Thu, 20 Jun 2024 16:33:34 +0000 From: "Dooley, Brian" To: Gowrishankar Muthukrishnan , "dev@dpdk.org" CC: Anoob Joseph , "stable@dpdk.org" Subject: RE: [PATCH] examples/fips_validation: fix coverity issues Thread-Topic: [PATCH] examples/fips_validation: fix coverity issues Thread-Index: AQHavxeSX7tKXVnlxUGPPEi0BTx6nbHQ4Jbg Date: Thu, 20 Jun 2024 16:33:34 +0000 Message-ID: References: <20240615113118.2137-1-gmuthukrishn@marvell.com> In-Reply-To: <20240615113118.2137-1-gmuthukrishn@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR11MB5056:EE_|DS0PR11MB8181:EE_ x-ms-office365-filtering-correlation-id: 1b8197e7-2a46-4429-ae11-08dc9146baa0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230037|366013|376011|1800799021|38070700015; x-microsoft-antispam-message-info: =?us-ascii?Q?Cj9YCvGMt++xVQosneTXJP8Fp8GcoSo9yiudg33fpliliOLZHX63hIbVNVnf?= =?us-ascii?Q?PerPS19bzUkIYRmyqo/1812VzM7zX/9MqTzX1Dq4PpB8KxxQ5/LiX3Tj7/Br?= =?us-ascii?Q?pKcr1xQ8R+p4S4m4KqEmBPu1j7WJULBfQpAOYaD1N7VYL8pOv6Fq/s86BNiL?= =?us-ascii?Q?UMNh1M7SxnASNRUumbPKH8UVuWltUVMRgLjh8zQ7AP8Y6XzmYXzREw4UcdVD?= =?us-ascii?Q?N4pSfKz7Ipg1oTwSYbI/h7lKd0j0rkT8JAHmeKLUsHb5STGfwuXWNg+Q2swQ?= =?us-ascii?Q?6IxmYAyJ91Bx3XF13hfhSpBfgcsMEmK+WTjggxieMy3EDMpVmSfBc1hBQjOR?= =?us-ascii?Q?JlwDyu9Hiy8OtILt3AawS14/rOPotbrmMIuxk+0E/s0evn1Jp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Siim7DQd3Gzz36ECB5pKgSHfniaki8QqAOy5rW0hsThGMYPT?= =?us-ascii?Q?wYifGGjt6SDTDm44LpL6Wk9XVkFqDr4UKOaf1s1LowLi96xfvnFj5SZX1+Yj?= =?us-ascii?Q?vsyv+Hc=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5056.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(366013)(376011)(1800799021)(38070700015); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xmOyVu6XkkS0Ci4dUfK1omLTMLfbhYTo2E4+S9yGVhzILb3wd7B3+Nq4kzcX?= =?us-ascii?Q?WZ9en1mOf+n+KK8g6ye70lFscD4b/BbSQ1hI7LXghsAIb9E38RSaRo4JfMUT?= =?us-ascii?Q?nV+4esTnlfUwMizmd1H0CARaKjgA2efxFF59mo9EwyW1dHkXWmWcjWVjCg7q?= =?us-ascii?Q?I2l/uvb9+irJareA1HrHYCtqaY37EX4PgdKCXt4NzekdXvwPjN/7WRH/N+6n?= =?us-ascii?Q?UPTOpELKJpriqsjwZbG/eV+A/3qBXxiVDLYJQb+40f+7Qw5WXgEsfWYi7iqW?= =?us-ascii?Q?7gbZU2e8vWqIgr6CgY1G0qGdDmUMWvyH8mX4ASmTfAqu+KRQmzWW7QuN1Ksa?= =?us-ascii?Q?/xJKGyBwnComaTUS9UuneGZE5/86EljKmfXjQV6p/jehHWV9WEbYmVrod5p3?= =?us-ascii?Q?PALce0pzY1SXVvbZFb3v5uGQwewznTEihR9gJykvqLBMa+ydU5XqmvpsMzpX?= =?us-ascii?Q?vG3HE1Z6KnDJE6O4Y5RbMUiASk9iTy/KQeP5zoJ0M+fNpb0Le+VJuPwZfwcx?= =?us-ascii?Q?14EANEg4LCWsSUX1/6spNtas9QGttwglGRFBdA/iQhOvCkh7rN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iFjpvs0pd0pL9UEwwyn2lmMw83wN3rHIdVB?= =?us-ascii?Q?1TjX3vHBC11Yg+0+9RgbWiAcyWuN2xVH0ItK1IkK7zz/uMHvDZoBmuTwY+Fq?= =?us-ascii?Q?yMVT2BooDq2tDGbboXAWluu7b8UYQeG34M9/d0+v?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB5056.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b8197e7-2a46-4429-ae11-08dc9146baa0 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2024 16:33:34.4279 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qH7tDqlNJYiFXt1CFmaiAWkeysc+Ze9IpY/RBinsGlOVb/t1DJ9H3TAgWGgJ2CIY1aA3/nlGNKWjf1XKtFrJhw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8181 X-OriginatorOrg: intel.com 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 Hey Gowrishankar, > -----Original Message----- > From: Gowrishankar Muthukrishnan > Sent: Saturday, June 15, 2024 12:31 PM > To: dev@dpdk.org; Dooley, Brian ; Gowrishankar > Muthukrishnan > Cc: Anoob Joseph ; stable@dpdk.org > Subject: [PATCH] examples/fips_validation: fix coverity issues >=20 > Fix NULL dereference, out-of-bound, bad bit shift issues reported by cove= rity > scan. >=20 > Coverity issue: 384440, 384435, 384433, 384429 > Fixes: 36128a67c27 ("examples/fips_validation: add asymmetric validation"= ) > Cc: stable@dpdk.org >=20 > Signed-off-by: Gowrishankar Muthukrishnan > --- > examples/fips_validation/fips_validation_rsa.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/examples/fips_validation/fips_validation_rsa.c > b/examples/fips_validation/fips_validation_rsa.c > index f675b51051..55f81860a0 100644 > --- a/examples/fips_validation/fips_validation_rsa.c > +++ b/examples/fips_validation/fips_validation_rsa.c > @@ -328,6 +328,9 @@ parse_test_rsa_json_interim_writeback(struct > fips_val *val) > if (prepare_vec_rsa() < 0) > return -1; >=20 > + if (!vec.rsa.e.val) > + return -1; > + > writeback_hex_str("", info.one_line_text, &vec.rsa.n); > obj =3D json_string(info.one_line_text); > json_object_set_new(json_info.json_write_group, "n", obj); > @@ -474,7 +477,7 @@ fips_test_randomize_message(struct fips_val *msg, > struct fips_val *rand) > uint16_t rv_len; >=20 > if (!msg->val || !rand->val || rand->len > RV_BUF_LEN > - || msg->len > FIPS_TEST_JSON_BUF_LEN) > + || msg->len > (FIPS_TEST_JSON_BUF_LEN - 1)) > return -EINVAL; >=20 > memset(rv, 0, sizeof(rv)); > @@ -503,7 +506,7 @@ fips_test_randomize_message(struct fips_val *msg, > struct fips_val *rand) > m[i + j] ^=3D rv[j]; >=20 > m[i + j] =3D ((uint8_t *)&rv_bitlen)[0]; > - m[i + j + 1] =3D (((uint8_t *)&rv_bitlen)[1] >> 8) & 0xFF; > + m[i + j + 1] =3D ((uint8_t *)&rv_bitlen)[1]; >=20 > rte_free(msg->val); > msg->len =3D (rv_bitlen + m_bitlen + 16) / 8; > -- > 2.25.1 Acked-by: Brian Dooley