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 4B7F1427DE; Mon, 20 Mar 2023 07:54:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 498CB410F3; Mon, 20 Mar 2023 07:54:54 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id DFF00410F3; Mon, 20 Mar 2023 07:54:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679295292; x=1710831292; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TgXf6HOAGCoJUvqZ7WDQiKCr5yLDARu4gqiOz3YWX1M=; b=HD3lY4F1fJ8RD2Tm3fiR0skRT2lZZezcx7xdhBtCLiwgpIt03DIDffca aQBCJwf7voZh1ZbpNdzCROkhfdP5ptJ+wcOefrO39uQGMpOiIYorWrHiq hjrJOegoiCeY0Bl9gKI6f4NYSzmknu1g3duFtOkGVPDy/xTw8cqUg2SF5 F7jazXweXt2Z+LXGdo6Gicsy2q7wcuCMbBDsW8el8fXqwKv3Jc/KWZT/l fil2Qf52GkEBA9B/DOWYCpeCAx7i6vbYSLp0BYOdLWQ3c8xZMrl+CgYs/ 6ycICXV0WTxXR3wv2GzID3EuHvzOwnXbHHaAF43b6ZIO4571fUiWjwPg1 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="338614373" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="338614373" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 23:54:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="745249632" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="745249632" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga008.fm.intel.com with ESMTP; 19 Mar 2023 23:54:47 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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:54:45 -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:54:45 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.169) 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:54:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RVfx6lPyFcVhXE+/D4TKWFnu7caqWW5Ovp/lvtI8O7g+ya5NB17NXSvYDZvxwG1v0P12XtOHgoc5rJ6LAcwhe+Hz6DiSJzJqegxyxgj0DEhNTyhpnRSm1SDSvZXEgwcWOrMrQHVwTacYNk9tLHyMEn43xqfPPvTiezVMykwoe6LvRUSnlgeHjT8fZ04rGZkwcNs2zUbFd8lXhpmDKuT1uc9NczxZGEnzeik04Nbf+8kYJRKpE4SuskPbRQLrowfIOFw8HN++Ewhm3WezXwnQlRonkV1zrrRw7cNWUvussxlprHUgQrhaK2na6zBxTGF0+T89OXYit7HfgaDasjjL6Q== 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=5XqUYZsNYGQYlyKy/VNNa60fYcZcDwo9ylD2lc26ssM=; b=Xgy5WLjU3VJgPoFZPJn1x+7J9czdkO3A9KtyqGvQHgfmacquXPZE+C8KZH7BHdjyk3POIa1BC1erb+ByKBqDC93aMwNUbDTulghmSAQgwnFViyEZOOtSMhuNjaIT04/LshSF2/rt1yPBEEPYwapdIG7EM19X97Vxvm2hJd/UFuClPf/Y4+Rs6ilbX2c1pZJDDu2GewXSdtUUB9OuKlSU2oM82xEdzCsAADL0B8MjVywTnqJ6iS2Vf5WfyUd56ou94TOpZnrfOW0IMIOitP5Hq6YBDaiNRKXdwE5kP0o2NOXCjeoRetr/GH1z2R69Gk4fcdFyO9sXtvlnEtVxZeSQsQ== 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 DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by PH7PR11MB7988.namprd11.prod.outlook.com (2603:10b6:510:243::19) 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:54:43 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e%7]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 06:54:43 +0000 From: "Xu, Rosen" To: "Huang, Wei" , "dev@dpdk.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" CC: "stable@dpdk.org" , "Zhang, Tianfei" , "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: AQHZWHHcc/HkyRLVQUW7C/+Mw+f0t68DQMMw Date: Mon, 20 Mar 2023 06:54:43 +0000 Message-ID: References: <20230316204412.338823-1-wei.huang@intel.com> In-Reply-To: <20230316204412.338823-1-wei.huang@intel.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: DM6PR11MB4252:EE_|PH7PR11MB7988:EE_ x-ms-office365-filtering-correlation-id: 0e56a12b-db52-4b4a-4b36-08db290ffc1b x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FJoi9FPLCE5feuxgDJIweVQU1kuKYHlDpyqRmqp7SsyV0RTzE5Yp17lmMa115RqOHGbBwh/iSq46h8YmjtSKqCHTNpi66e2tGyRJvUp5MzMVhknmNLhRI4A9ky6909UVkI5AaR+9LSaRF059P8n22a72heD721G8LE+QmQLUwednXLd7jUuf7FT8d71283OCudjERuhYkvD7w+xVgujbwj5yRl1NhcD2mCp4bJ14hdMqB6Y/FF0upUUrC74hIa1fDXImwNFjM3OSSc+dLoCXCeIBskQFUouZV2amVvkmOOHOcbkY8o+hkV5PDyh6xnBM1WN+thri/dYBwxnKZBygQgFat10s01x+/ZXL926XW99e5tzcb2/1E/j8cKeZXwMDmOSzKFdnbhNYzCkFrCH+V4HhWyyDA/tZ9pLfmA0u7BvdSRLbr2Pa/vq/WRsKtnFn/21dUYvqciDk3xXGoi+mVgWEOOaxjHK7690mPS/bUc4ilJE5mPEcJp6ER+3gB9Mmq+J4S+5lqU6MAobhiHLO9dj8QnI2G8SHqLpwDwOVBP0iwoP5V0cd7vw2MLDa4u95iYNj8qZrIgH6Ga9WROqFr6f2vzAFgS2xbMCu9Ayzct5Iisff7ZBw51iLx/TBR6DoYSmGPEFxg+/nVCILEb49DeWyiC9dgo2puFTANRrTRalynzmIgsFzlzu4vO6mXip2 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(396003)(346002)(376002)(136003)(366004)(39860400002)(451199018)(110136005)(478600001)(316002)(26005)(6506007)(71200400001)(53546011)(54906003)(7696005)(82960400001)(2906002)(38070700005)(8676002)(66946007)(64756008)(76116006)(66446008)(66476007)(66556008)(4326008)(122000001)(5660300002)(107886003)(86362001)(38100700002)(41300700001)(33656002)(8936002)(52536014)(55016003)(9686003)(186003)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?TxsXYSSStpUunJ6qnLXB1+gcdm0h2quW3LJqMrUEN7Q5TX4K5fBIYr7JVvqN?= =?us-ascii?Q?ckMN9ZTjL3yGjAgkx2g9C2gfopP7zPlZVvX9oGOZX8P/4378AyLTIeDIbZ4f?= =?us-ascii?Q?0U7LHzK/Tv93QLSDgkweBs5LAUbtZ2zdQmFcVGydgfjJAMmxh+RHcxY4+1vK?= =?us-ascii?Q?mC1nL5zDY3TZB0w7hz54T1kH6vhuvMeq9AWtyjzqqWs1PNYAHqIN+sI4VBR2?= =?us-ascii?Q?96FOPxt2J39odZTElRABc5nr+NiRfG8QN+B9cYL4L/FDIrfeHN0CBt/064vB?= =?us-ascii?Q?f4avD1JRA19uMZmT9NjnHa+UB8+V12WiupWHzetpF/1byw1zPH5x2MKHmPEJ?= =?us-ascii?Q?zW49jUAJGGRvq7wz/8Ff9vdwwDzivLBk5Klff9E94r08pYRQd5gPfn47g5oM?= =?us-ascii?Q?6k7VQ3H4W5s6qXGU92rsIsZDkuPwdImi+7Z+tTysxGjy25K0HbY23WlqJxWQ?= =?us-ascii?Q?RgqMUzRPKY7ZQVhmo9Qoz2O+ol1YK2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Crcuy3jr5ZK1jaSVdxoQCD+8nCaMkDUdwK6ii77aGp61l9Z?= =?us-ascii?Q?QU3gB9X6V6IGf0rtvfQmdOp0WtJTTHUDZeSiqK7I5zUEk9019RfK5rKl6PBF?= =?us-ascii?Q?AjNODAcwb5VWNo+SkaUfmcEf8ixJ/MVtA6Cu26hEOkROq7OJ06/VxJoSGSGr?= =?us-ascii?Q?AIcxfVQ+YvqnJ33ZDj05EASNvzpeaF4L6lMf6Rxy?= 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: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e56a12b-db52-4b4a-4b36-08db290ffc1b X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2023 06:54:43.3640 (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: uwehF+nex5c7bVen4O3o5WDEfADOgn/JB0TjjojfU1VJapmumSeZH1n9l/+SstGCnO1lNr1a1PvDcc9TgZAiug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB7988 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, > -----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 fault. >=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 Acked-by: Rosen Xu