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 D72A8A0548; Wed, 15 Jun 2022 04:04:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF15D40222; Wed, 15 Jun 2022 04:04:26 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 2619E40220 for ; Wed, 15 Jun 2022 04:04:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655258664; x=1686794664; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=qppfCP0gi6NLhGG/GZVSGFsU4AnmA3fYqLUbgjGdkwE=; b=jBTUF2TTGc2RyY213BV8dsfUv45nIh5ScrGYXhe+yWVsmdU+cNs27HIS oHXJG/Pbl0UXuCA/pXg6x78ivWMGPQdO3lpIg7IHlgLyLSklKTPjQyGwP 3ZjxhDCxuFo9BOtNQ08XdnIRLL/Fc7T2dtqlfzORXn061JREBA0zQ8/Ou mVPQFF9SqXqYZKajQ97fHLYn0FD3OsJ3wHMPwP44MdypCdmVyWxdLn5Kp 2GfUd5Dn3Uqz8GaJYDfbedR5G/bYeISZEdrKOAfnFM50PQi4kBy3yTHEZ DqEVo80Kk7cZwuE69zn7VNHSa1xbgLMUBM5q5R4cPUxsySgEWc8Phlo4s g==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="304226555" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="304226555" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 19:04:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="830760076" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga006.fm.intel.com with ESMTP; 14 Jun 2022 19:04:17 -0700 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 14 Jun 2022 19:04:17 -0700 Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Tue, 14 Jun 2022 19:04:14 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Tue, 14 Jun 2022 19:04:14 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Tue, 14 Jun 2022 19:04:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=losNANR+uyoz3TlRRBqhW0t/2wKlTDPD5fhX9m5T6nGkmDTYTPBBJ/+iDzbfeH4cp/o5tZjFBP2EvKfvgK+xdUkHJsF+4HqKxyBPeUNwK4uN/vc8XY474LppGqxatnHTWyCMeKL9kpqG8xqSvEy1SpYehvN60d/RuoEhNJPuXEGVgyQ4J+gPyqswrUst9JZN5PPdUZ4pdeW3GPYnLDzXmb3hlNv4Q15rc3xtScV171RTk5igWTnURqAQh0tPq3Tw0LZo3s5S3AyyUNAjrDc5t7teLyavRRr04fkNYBCxneozWGEfGZfeCtiB489Odfi1WdpNfVW8ZQAD6XUqod33GQ== 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=SCSvse6gOQnrc3g+Coo+6z8EFBH38kCRfUVbTlQvz+Q=; b=COvD7CAFEuVgc/9yaVPDjSV0yAG2bVvWkYpWDFeml1TSuFhFGSFaoQZhlDPfjBuyt9xXcNlz78/RJPBhcMfhdG962KxhK6kLFFyMLcD9otAUPkcGeoz/z2gygZSMAyVC+e3y3HA54b64jAENXVdbMvrfLYPa0f1d1m2HWbbEzeSt9cnLAcFN9YcADeQvmv63uSETG188hdOmkIECpUJQsg9TV7+clCkkn+tH1qKYYCd5G6uiGkNF7KxLqtjC8qY9OklAVOLihLHMpAB3rggYgYnsJWbAY1jEVKPdvvZNQy19Qt81h5mYdEp424z0uLsGtsX94IPNyyNcRjMjUXwKrw== 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 SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by BN7PR11MB2818.namprd11.prod.outlook.com (2603:10b6:406:ad::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.17; Wed, 15 Jun 2022 02:04:07 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::54a0:2dbc:18b7:2aa9%7]) with mapi id 15.20.5332.020; Wed, 15 Jun 2022 02:04:07 +0000 From: "Xia, Chenbo" To: "Pei, Andy" , "dev@dpdk.org" CC: "maxime.coquelin@redhat.com" , "Wang, Xiao W" , "Xu, Rosen" , "Xiao, QimaiX" Subject: RE: [PATCH] vdpa/ifc: fix null pointer dereference Thread-Topic: [PATCH] vdpa/ifc: fix null pointer dereference Thread-Index: AQHYexEAqsAwjEp6vUK0BgI2ymovoK1PwbFQ Date: Wed, 15 Jun 2022 02:04:07 +0000 Message-ID: References: <1654673642-151882-1-git-send-email-andy.pei@intel.com> In-Reply-To: <1654673642-151882-1-git-send-email-andy.pei@intel.com> Accept-Language: en-US, zh-CN 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-office365-filtering-correlation-id: 9a8c6997-ee3a-4eca-41df-08da4e73548f x-ms-traffictypediagnostic: BN7PR11MB2818:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 0dMCCATBL6SRsuLHgl3sA/RB5LAThDS7zStr9jJfvoxD5QJjZuc67L82EJT1Lro9qkqQaVBiPq3+Vwnr/MTWUEFllnxmpyXjrpCbfw0TTleGv54nJp/R7+PhUKgm7puSeu0TSzERMRL7+mKZ8HsR1hbDsoIZmQIA/sQsDst9OmBmXbWFtU9lDveJa5J4Cfs0V7VbHgVjWO2tP+3WTEMBAY3NmjqczN8BdBtNvPesb5086Pgk6s5qEd2xBm296Gg63oiDi57QElcpmR8mWsJ8CEYv/P9OIfP/lnotbwKtT9hEHfVirn1eByw35kRsAehjOWzYpR1w52XeEqIc5CxYsXdFhenaufKXKSEZZ7Jw+e/iGSCOnHKjR0eyI+Q894CCsnJXMJC7b3l8bjLQwe8mTQcijNKWsXrhQcYsgAf772iXLc2cyDhaD1TjhGm8SZb1rDINv6a2T9nTi8YJ/2JmOOPCrlKMtWYwbHDwdwbZYGoG6PECLuTBbA7VHCWxYE7gUnYY+eJOf5qRVW0GA5SamutvAf2TuhLceYl/ii6aOEgDmaX5XXvO1Sml0KiumS57+inThkDWLWKuBXpTw11eUBU+Wav1TGIjpgM6/yiLiW6MgDIhK/oSmFMMuA3xSPtCAQoJCg0eGIY7B1LrG5Y1A+uA0I3cOSkk+NWPgAhLzM4PvOyNCRelaRcvblWjLet8cNUYccNw0D8PfBGrIihqxA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(82960400001)(186003)(64756008)(122000001)(55016003)(66446008)(66476007)(38070700005)(54906003)(508600001)(8676002)(66946007)(4326008)(66556008)(110136005)(83380400001)(6506007)(7696005)(53546011)(2906002)(76116006)(107886003)(71200400001)(38100700002)(8936002)(52536014)(9686003)(86362001)(316002)(33656002)(26005)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?WKbsOYMAqdWToDNs06mggKuXekVEOApL1UVz/k9hhijbjO4bs9qypueNj1BU?= =?us-ascii?Q?c6HpKlumOEY0zCqKB1jC+xI25x656tqxgvZS1FNHJ0vW3VHt5KaKuiKaiw6g?= =?us-ascii?Q?ZFgD7+NY7pChOCL1wQcGliFdEl+Swey8fX6Heu9xm7kEgUdl+tWQ4HDnm0bg?= =?us-ascii?Q?pbtcbFDiQUjvGTuS3YYCQaCgz5n/apWrpO/gHKFZ82Qdl1y+1dbp8JW1sCyR?= =?us-ascii?Q?7r+vTUaOFrfO0dEolG6L+2pSntNaH66FT9tILFhegCwEKV5Hj7t0qLZICpzO?= =?us-ascii?Q?7umzskQjvaNNoF3KD0ZrjRXA8PREyI57lXsZ873c2zkkgJni1+nFj/M7A4ox?= =?us-ascii?Q?579dq2ya1CqPvXFx1jse3SXH+kZ4bJ00zoQkrSxyexHDSH73pAn5P1MXZ8kC?= =?us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tbCYv8kh8sxg?= =?us-ascii?Q?wtNUwIoSuYukXTX9l0HV1pVx8HwfY2AySLqhfHQZ0wqcpdrqC9KHaHNHpcCq?= =?us-ascii?Q?bKWOxH+b/ks9xE3BWxp+0EZxf868S3P5RvOQjhpmTz+Bu4I2Hh6UUCTAbjMy?= =?us-ascii?Q?oVvJMFf40ZO/bYzJ9OtZycuvvn+OZD/d0HPtKnWaD5CUF0eWAhMPMAxvw1jy?= =?us-ascii?Q?rCeXiBJPjZO013alZwgjXzZnPpIf6H/O2k46UGkv8W8CcFsFe6kg0DV7rzYl?= =?us-ascii?Q?GJuqXV/maMzSeaBnh+dR/d5VSKt40RyzJgRXyAmn3fkSfEdZRgZZlZron3Ah?= =?us-ascii?Q?i/IojNh0Z5tHX9jq50/E5Fo+3hSVRMCaZhQR5x+iRryr1+47sMI/GV+P/iHE?= =?us-ascii?Q?L7UntkIwqQswHXz5sq6nqq3RPcH8EmKtohVSnsQP4ndTgiTth7iFqA023wAE?= =?us-ascii?Q?dy3b5pCBPQ=3D=3D?= 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: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a8c6997-ee3a-4eca-41df-08da4e73548f X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jun 2022 02:04:07.2601 (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: K3vBK96meXBBHJwWiiG3wgJgBacW7QQP3VLpMbYoVH1pta3t6NFuYGg4O1WyOBP1koh1a7YlfndnvoDbqLV2Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR11MB2818 X-OriginatorOrg: intel.com 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 Hi Andy, > -----Original Message----- > From: Pei, Andy > Sent: Wednesday, June 8, 2022 3:34 PM > To: dev@dpdk.org > Cc: Xia, Chenbo ; maxime.coquelin@redhat.com; Wang, > Xiao W ; Xu, Rosen ; Xiao, > QimaiX > Subject: [PATCH] vdpa/ifc: fix null pointer dereference >=20 > Fix null pointer dereference reported in coverity scan. >=20 > Coverity issue: 378882 > Fixes: 8162a4a9 ("vdpa/ifc/base: access correct register for blk device") Commit id need to be 12 digits. Also pls leave a blank line between Fixes t= ag and signed-off Thanks, Chenbo > Signed-off-by: Andy Pei > --- > drivers/vdpa/ifc/base/ifcvf.c | 9 +++++++++ > 1 file changed, 9 insertions(+) >=20 > diff --git a/drivers/vdpa/ifc/base/ifcvf.c b/drivers/vdpa/ifc/base/ifcvf.= c > index dd475a7..0a9f71a 100644 > --- a/drivers/vdpa/ifc/base/ifcvf.c > +++ b/drivers/vdpa/ifc/base/ifcvf.c > @@ -255,6 +255,10 @@ > u32 ring_state; >=20 > cfg =3D hw->common_cfg; > + if (!cfg) { > + DEBUGOUT("common_cfg in HW is NULL.\n"); > + return; > + } >=20 > IFCVF_WRITE_REG16(IFCVF_MSI_NO_VECTOR, &cfg->msix_config); > for (i =3D 0; i < hw->nr_vring; i++) { > @@ -262,6 +266,11 @@ > IFCVF_WRITE_REG16(0, &cfg->queue_enable); > IFCVF_WRITE_REG16(IFCVF_MSI_NO_VECTOR, &cfg- > >queue_msix_vector); >=20 > + if (!hw->lm_cfg) { > + DEBUGOUT("live migration cfg in HW is NULL.\n"); > + continue; > + } > + > if (hw->device_type =3D=3D IFCVF_BLK) > ring_state =3D *(u32 *)(hw->lm_cfg + > IFCVF_LM_RING_STATE_OFFSET + > -- > 1.8.3.1