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 E44A5A0548; Wed, 15 Jun 2022 09:08:31 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7BBF415D7; Wed, 15 Jun 2022 09:08:31 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id E85CE40220 for ; Wed, 15 Jun 2022 09:08:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655276910; x=1686812910; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=W0Jp1yne+6ZAnxZijCZRKcKsWAPUMQi28SWkGYAdGfw=; b=eEWXdNWCzSE8fTwSahJbmIioRF3X+1boEDg8XWhEBbaIO+2Q/CwouZJ9 v8TKD/KcsA0OzdcyhjJdHPVxV2dD2wMuq2nSxv2Fnc8ylqxeCN0RdwciH o2eEdt/eTnbaeXSnTBucEMQSL1v6an5xmTYHYYrkCAH89aY7fAwZ39lgh sT5ovJpc3Mk+HlCJxDTLcWtOwgE8AtwrVHqH+i7mE4AneCm0Wi+Z+p3d9 yNNpbOkcagfpjjvtUGRx6SuFN8deMHUBvDigUs7sPUMbGXDBKSGqLpSRK xPtJUH1C2Jh4602V14NUqTPr4OQRPChU3po8I/5bsPNOro3o3OYkliqJ9 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="267550577" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="267550577" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2022 00:08:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="687142696" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga002.fm.intel.com with ESMTP; 15 Jun 2022 00:08:28 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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; Wed, 15 Jun 2022 00:08:27 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 15 Jun 2022 00:08:27 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 15 Jun 2022 00:08:27 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 15 Jun 2022 00:08:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dSzUNhiKSZXnD/jahR6ZUbNnNkwu/Wh1zXROMAcOeZZ8pdzZSVroB92Fwcn6zUbWN1Khs7avi+DXQret1ERFPAwK0DzLBB/mH390rcTZzkClxCbp+ouVOflCwh2+d1QtUeUIz7Zs1DHhHivMn7bJBr7osbo4/PqtQm6okR9qnbA+8uHYGJw8iol99H6hKPkmFqIkprLQS7J+UT2kwhEbgKpsJ4u4dyaR38yBmk9VL+4K2Jbtk9m2x2gg+6vUPIpSr/fLoElBsDIo2j+NV0B5tSJ7AgpWCEtmXkQi99L8Ln+06Y24zzjwMfuYwBu+4QnBcKWG9t/FHQY7niX/J1yDBg== 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=yaw+IbjlcjJYdMEK5Hem5rFygzZY9rWiQbKtfGDIHlc=; b=ShhYGsyCoRySVB8zZRDImw8G3D15sOrbmmO1fuGA8y8UP86k+ukif3bbBoE6Y6AKbeGJcPWa3HqURbnAODqrQ9CsaQwAw9jEYEvh4OglaE+9o06kRdMFbqJIjWNdBN4+OBqpAip0i9IjdvTdP0gCFW+4jLnGar59hTLrsjYRvBpOpF86A+xk1yUkBt3mhQZYhDRrS2hBzK/gJ4lDDbgM2RkXINIX3ZUNhAYbJoJwqdUBZZKpe+ovqAdbCvzV3X0+/wZyV7Epz0Ks3aQ07jakxTiW+/xX8AdoKJ1pGAXzla+wHLcxc1/8qFgeMATXs3GG1+5uUYwklwumk+7x8MaqZg== 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 DM5PR11MB1739.namprd11.prod.outlook.com (2603:10b6:3:111::22) by BL3PR11MB6530.namprd11.prod.outlook.com (2603:10b6:208:38d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.20; Wed, 15 Jun 2022 07:08:25 +0000 Received: from DM5PR11MB1739.namprd11.prod.outlook.com ([fe80::8c3b:8a54:d186:b555]) by DM5PR11MB1739.namprd11.prod.outlook.com ([fe80::8c3b:8a54:d186:b555%11]) with mapi id 15.20.5332.022; Wed, 15 Jun 2022 07:08:25 +0000 From: "Pei, Andy" To: "Xia, Chenbo" , "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: AQHYgFwx+TniPfpbuEm+yrGoobWQLK1QDG3A Date: Wed, 15 Jun 2022 07:08:24 +0000 Message-ID: References: <1654673642-151882-1-git-send-email-andy.pei@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.500.17 dlp-reaction: no-action 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: cf15f8a3-1306-403a-495f-08da4e9dd6fc x-ms-traffictypediagnostic: BL3PR11MB6530: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: Fi9cO+dU3gYTlA77/aTl6xGWXHZLgwsW35WmddVNa/GRbEi2XTJ2R3Tn5bHsFBpy8ATCVwl07Tg6jCh6GN/J2sNazw//vmI3UPXxlMiqYOhRcluMUFBm4kR0zGLJQi/Gx5VvshnLNewRUIN7MP8dFXWvoHU0By7PfLIHYCUBBDq4Z01FnWUqnzal9IKNT0JQX6a/PzJZKcxZrd0zffr8xXDfy8L/UUJqQnN8/puNTLPsCRywVIivOvb4cGr5cdYleGbV5txmKtgGQKA17CdiS1B0dHCOZLu67h1HjgOgUAfUJmFZnf4g16EA9j1PLLDhX74egy8uj631MTkSF9vloMt6K2WW2KgOqiE3X/2ICgGb6Od1os7gVEjsrk6aa8EtOOWxkLUWiW092xYU+XPoguzm7PB9YIZKW9YsGsL+xag+nE+5TyzorN9Sh2Sj0TEm/SdFJShW+tdQyBRNg4PWlO7fsSkOnRCJQUqMdkQupQ2JFfi00pFP5C9FjuxUrxzRSuBh1bewbarGuB4E4Kf3lKMAco/d9LHXyWcLx0wUtu8jtbTTqQscL2BbDWYeR8yv6R0GUCFjiAodZ3ffvzqwS4oFIrGzIexUiLEMPXumjBxrk0FT/Lj9ch86FJ8QJtITxC6qfOLuqxQbAZ0OLDK1nXp7iQ68TOAtIxpjwRoGfKPyAH7oYjm42hE6YNNfSWfo7RgjUfhpA2AU25gh9kw9uA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR11MB1739.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(366004)(86362001)(2906002)(6506007)(5660300002)(66446008)(7696005)(33656002)(55016003)(54906003)(110136005)(316002)(71200400001)(53546011)(82960400001)(38100700002)(122000001)(66946007)(66556008)(9686003)(64756008)(508600001)(26005)(8936002)(52536014)(76116006)(38070700005)(4326008)(8676002)(83380400001)(66476007)(186003)(107886003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?arqCvMWFpCUunvrdiJAOUCQKjAirdalE8z8u8QC4cHoordrIeMVxkRD7YU+p?= =?us-ascii?Q?nsYHe1BtXXE2mSBa6K4WoCIWXOefPkIApG2+KS0udeXCg05rmNPKyIDckC55?= =?us-ascii?Q?fhkHDU7Ac/TuhRjv4K6PXSXFRB+ySmn2QiH+ZzVpFktuVw/+soGfvW+zMu1y?= =?us-ascii?Q?6omlQLQemeik0IfaxWZsufjmw3gEL/OmRKhYpvwemqFVrWMPP2p7YMxTD6Cw?= =?us-ascii?Q?23c1I02R6ydZE+Bi3eHLlTWw5qlEYCQYCU6A4nRrt4Ywlno6des9RugXHlCD?= =?us-ascii?Q?76eQkz1lN0qFzxp92rCHRMuAVeGeGbW8Z+GKawW/2ZKy+W3PB6Z650y+6tGK?= =?us-ascii?Q?8hAvO+nPnorSmK+2pRWQTouZDZJIEPpY1uDZVmZIFMoKrj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tH80ECopcN9/jsfHOzuYevwck57NDdTJzipqIj5lTUpevtvpLpcmP?= =?us-ascii?Q?sDSYXblAL6BH2VxO5HHot6Wy2kKfaCtjHTTSDKM0LYDnKlFXwdpOwPAa8ENQ?= =?us-ascii?Q?IqyvqCKO0fIAqTP7BxKDoyZ4h4YjgRScJIiO3q0TgI0jm4FC5Xpdw2kFNDma?= =?us-ascii?Q?TqgPRrf+8n7tpFKaSPGcZqIuVMdw758r7bRwuKj653wzSEM82rQce7k5JkKe?= =?us-ascii?Q?hp2Mw02D5bFI0t8lTVI/azHY8Xcg3vr2e+rkj2pqZNzuSmBPUmo58Ng38OrB?= =?us-ascii?Q?MS4mA696MlE2v/ILFO0uX0/MNdf/jEag00mulxSeqLiDlg6SqyToBOjhrDkM?= =?us-ascii?Q?zAf2oki7Umt8aY9TVr3nzQehmIRElISaoHRoCHdnTX2gZJzocKSJ16iwdYqp?= =?us-ascii?Q?IjS/byyUUbQWW0fgtFXYmrsJ9v6p5PmGy2bXLJwxxFJXi0su6n07YxgSmrsL?= =?us-ascii?Q?p0+t/0AGcw=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: DM5PR11MB1739.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf15f8a3-1306-403a-495f-08da4e9dd6fc X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jun 2022 07:08:24.9411 (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: EzGeW9GaoZ/OZZihf93IWYEKqr6XKPgn9aTvNqQbXFpz7Qh/nC5uQVqtt4peQFTq9yuiuQ9lrqucTldNjBYZyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6530 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 Chenbo, Thanks for your reply. I will fix this in next version. > -----Original Message----- > From: Xia, Chenbo > Sent: Wednesday, June 15, 2022 10:04 AM > 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 >=20 > Hi Andy, >=20 > > -----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 > > > > Fix null pointer dereference reported in coverity scan. > > > > Coverity issue: 378882 > > Fixes: 8162a4a9 ("vdpa/ifc/base: access correct register for blk > > device") >=20 > Commit id need to be 12 digits. Also pls leave a blank line between Fixes= tag > and signed-off >=20 > Thanks, > Chenbo >=20 > > Signed-off-by: Andy Pei > > --- > > drivers/vdpa/ifc/base/ifcvf.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > 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; > > > > cfg =3D hw->common_cfg; > > + if (!cfg) { > > + DEBUGOUT("common_cfg in HW is NULL.\n"); > > + return; > > + } > > > > 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); > > > > + 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