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 5711C427DE; Mon, 20 Mar 2023 07:34:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3419F40A7F; Mon, 20 Mar 2023 07:34:14 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id E2007406BC; Mon, 20 Mar 2023 07:34:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679294052; x=1710830052; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=f7lzY0RZUD3ZjKPxIoTyHprSc/QHVxX1mE6+ngLDkTk=; b=F9W9fE2dup4msMYvzG3IEX9VWhWbkve0znST2ndTMGYmFxwXpa6V+WT2 bfeOiSV4I+OhEHucxrherAlD3iS84C7Lv6CeyFQVVZWbHWRHbv/S2Gsl4 kEwuQWKjNhNrCm306ghWqFuDP19e5BVrA9vNrvbDYqDSV+BDkghmixdm5 hiQ7FWoTKYzx2ukaQs7D7+goXWtwegOvdN5nwhY6q0FJd7NuNECVyRWDp R2YCFrNvbQFWztp7X4hE8q+cKZdK5v1Flh/jnys75BpJONNNVlYPCfLjc p+6/MBii8NzgM7C6gmJ85keEuTnHgdRjpr/ht+W95YWv2vkk6m+hY90iH w==; X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="336085319" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="336085319" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 23:34:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="674225849" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="674225849" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga007.jf.intel.com with ESMTP; 19 Mar 2023 23:34:04 -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.21; Sun, 19 Mar 2023 23:34:04 -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.21 via Frontend Transport; Sun, 19 Mar 2023 23:34:04 -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.21; Sun, 19 Mar 2023 23:34:03 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OWBsQPvz5kRJb9aZGAP4sEyCyTFeuJNu2qJ5kcvkoO+dA15/ge8oueVEngxQtqt6Fl9gcL6F/oBilWCGGrYlDaKaZm/OURE1DOzO9lXJWW23PaoaxfQli/o/0OTWOQ40oRsY8BS/R5j04pfppHaoZwU2EilHPaqKnG56+ZkKrk/LqiO0nFXEQ1m/nn+NpPBL7giEh85B/pJRzvbojy2/ztQIe1+cxULXKf10UV1nBMa+zyYy+QHDmIPU4kwfoz7evs8zFR3+HKwauxtP6tr6BYSgq1F2xK2cA3vnLc1XrvYKtaCU2ujV1XSvEcehf5yYG1unP9g9VvRwLCQgeXSrCw== 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=aNxlQvlllpFVPC0J3AO1X/rn2PdHI3BZBJlZeEqIuj4=; b=DqfOzKXvvydQWfPEkMpwiXi4T2/mshXRkfOpJJmYA+l59ZjfZuit/FWkvCWPls2PTqdwrrbNO32FhQlOVO0mf1gc4x26kRozZrPXIl/YTGMqpz4JsmSw8h3REjzm90i+j3Lr+/IPyb6C0Ji1eBW4T3RfSOxYhNeEtO5SkYTFXd6CZz/mMbcit3jsMSADf4PajtvzfMHGD5YUhsohA0N+V3+ybjrT6A7i2VPS8uXnj6OWHYQXoNNIbpWKdPoIndHV8lQZ+7s6n4RCDkDG1BxmmkbbydGl9IG6TOKTM18wLwKfNwUjJlxf9tWXUjPiWgQ3MBrWPNsHvUimbylRxrz9Xw== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by DS0PR11MB7334.namprd11.prod.outlook.com (2603:10b6:8:11d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 06:34:02 +0000 Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::af70:de56:4a6f:b2cc]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::af70:de56:4a6f:b2cc%7]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 06:34:02 +0000 From: "Zhang, Tianfei" To: "Huang, Wei" , "dev@dpdk.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" CC: "stable@dpdk.org" , "Xu, Rosen" , "Zhang, Qi Z" Subject: RE: [PATCH v1] bus/ifpga: fix issue of accessing null address Thread-Topic: [PATCH v1] bus/ifpga: fix issue of accessing null address Thread-Index: AQHZWHHc5MfoPkR+uEyuxQxZvT/uD68DOsbw Date: Mon, 20 Mar 2023 06:34:02 +0000 Message-ID: References: <20230316204412.338823-1-wei.huang@intel.com> In-Reply-To: <20230316204412.338823-1-wei.huang@intel.com> Accept-Language: zh-CN, 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: BN9PR11MB5483:EE_|DS0PR11MB7334:EE_ x-ms-office365-filtering-correlation-id: fac97930-dbe2-4be4-fd67-08db290d183c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ISl70fsD52Q+/cR83nh4bzEia9zJ6glF0mUG3SxZpaNklL6hTJFv6+6iRyg1WjavX4MBE2T6VrZ8BKHu5uwkIiRGUYte6bgNdLxwBqCcux/ittn6PGl4CWLGIvA/foEAeFZWRRpBCprZYqj1QqgSq/12j2fnR4dBrjIau+OCzWjo3Sh+AU4/ansibO7AMP/pOWs3JOQXI3z8DOR9DQZ/gXMn6INFDaj+n2tgyYOuSvc5iuMNptC3lQoJPw5z5CX0Dv15yvUTsJVi7r7aN4IhCUObrXOnN+OrDw+1UY3xuJZkBrIujHWGUj5Tv0sYAO0D1CXUttWXTmg38ZSbefqpiijynI99kGv7Dm3I8rjsUDvPosAVjtn0c7Q3hr6hIhjITjv2bSU/cQjNqXFia9TDJs7yj8tfi+dTpJ74U1T/PfXgRSwAj5rAZAL1iJOW4b6JmiMr6LBbmUHgoq/9p1Bi7cDw5L7iTc8gukkL4auXMmYAU0o5Lx+dA7j4JMCuLZGzUhaWyw6CBanTeg+Ae85PuwNAGvH644S5JUlXhNYuDNSV01e/ozDIED/a8/Gogcd20DlHdJXDKkX2d0Z9oJg7BaCSDRgiMCm0T2CvXAxHQKNZ6Rwof3nKRNh4E6a6GGmwoZvXbx7P4QQc1aQGP1hhKvKC1zx7CfieyxXgvfW1S1l4s0w0FXzShO6rn1f+8X28 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR11MB5483.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(346002)(396003)(366004)(376002)(39860400002)(136003)(451199018)(53546011)(186003)(38070700005)(82960400001)(107886003)(6506007)(9686003)(71200400001)(7696005)(38100700002)(2906002)(478600001)(86362001)(122000001)(83380400001)(55016003)(76116006)(110136005)(316002)(33656002)(54906003)(4326008)(8936002)(66446008)(41300700001)(66556008)(8676002)(52536014)(5660300002)(64756008)(66476007)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BxUZ3Lw8dmHrZb9oMi7RQr+Y5LJpcYlJR8xnlPfH62x/NWaSjlAGira18YP9?= =?us-ascii?Q?FTAI2h7Vn1DniRS5DnV15qrH495cpzhRY7xIwwYJDbW/AXeS/j8vqyye+rFu?= =?us-ascii?Q?33/HOkalU94vDkz3c1q9moTll7J5HNC/tlpRxpOeIYGZPNJ/g7B0d3SHR51F?= =?us-ascii?Q?ndi/0WBNgzXC9hgwXh9nvEjuF1KJWPe0pOE9HAufSxT6gmALpQMGoxnI127y?= =?us-ascii?Q?F4lReaDWhZdnQPwq5b/NelXvLnBb8To+4tH+9X2o4kwQTQ2UqlaD7Rj+dKUy?= =?us-ascii?Q?k2rhlQsqwTkZF4/1CSsKPV9C2VhQrLkNr99KpWGmzFrEJzkLP2taC9gLNbri?= =?us-ascii?Q?kw3+0QEg5bKVXWTZSWzBrvALhWrggI4rX5DnZP3pdWfmy/Ea2Hk+GQ5ksOdf?= =?us-ascii?Q?SmHH+OyMjF1exF2ygN/c4RLBcS2qxiiHgp5ECKsWLHWTGcgMWcOTVE2mXi5i?= =?us-ascii?Q?T0ERoeV2EElwP8OWf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-ascii?Q?B0g0s4uxkwnYeDxpmKeCGGx5ywpYHDDoYiXSrkK2XbssKw/jdROlPy5D3bfJ?= =?us-ascii?Q?GOPqrD5oi5GpdS1urCB64k0mGbEGgkBb25tSCMCeCceLiQj7wnGtNxEtgbIc?= =?us-ascii?Q?7CQyMzazHweQKVctx93X1e6BW3nj2r2hBNPoPYZwJjIgENp9MHj3JHA0uQI9?= =?us-ascii?Q?wUmcGNsbIr4xyVAWAQE1r4oQCPXJdxdEau7TP8HhVIdELMIXSJBiKJ/9/ZdC?= =?us-ascii?Q?NEB/0DmeEKiaPze/l6MflnYNahjDo5NCyUfdSMlIkhq8?= 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: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fac97930-dbe2-4be4-fd67-08db290d183c X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2023 06:34:02.0396 (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: HBLUFSDETydYh0ACG5mDqMEkGtU3Nvl6IkX9tTqq1Lo4HlDt2d9i4NU52AufvQUGE57k5A5ui5dQQ9F/Yd1X0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7334 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 > -----Original Message----- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:44 AM > To: dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com > Cc: stable@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] bus/ifpga: fix issue of accessing null address >=20 > In function ifpga_scan_one(), variable 'path' is NULL if device argument = 'afu_bts' is > not set, subsequent string copy with 'path' would lead to segmentation fa= ult. >=20 > Fixes: 6fa4aa2b3645 ("bus/ifpga: fix forcing optional devargs") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Huang > --- > drivers/bus/ifpga/ifpga_bus.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.= c index > bb943b5..07e316b 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -135,6 +135,8 @@ struct rte_afu_device * > goto end; > } > afu_pr_conf.pr_enable =3D 1; > + strlcpy(afu_pr_conf.bs_path, path, > + sizeof(afu_pr_conf.bs_path)); > } else { > afu_pr_conf.pr_enable =3D 0; > } > @@ -174,7 +176,6 @@ struct rte_afu_device * > rawdev->dev_ops->dev_start(rawdev)) > goto end; >=20 > - strlcpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path)); > if (rawdev->dev_ops && > rawdev->dev_ops->firmware_load && > rawdev->dev_ops->firmware_load(rawdev, > -- > 1.8.3.1 It looks good for me. Acked-by: Tianfei Zhang