From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id C040C1B786; Tue, 15 May 2018 17:10:08 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 May 2018 08:10:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,403,1520924400"; d="scan'208";a="56105232" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga001.jf.intel.com with ESMTP; 15 May 2018 08:10:05 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.194]) by PGSMSX108.gar.corp.intel.com ([169.254.8.47]) with mapi id 14.03.0319.002; Tue, 15 May 2018 23:10:04 +0800 From: "Dai, Wei" To: "Yigit, Ferruh" , "Burakov, Anatoly" CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] bus/pci: fix error in parsing vfio driver Thread-Index: AQHT7F2MOnZn+pm+KkeVPJMGpicqhaQw5Hxw Date: Tue, 15 May 2018 15:10:04 +0000 Message-ID: <49759EB36A64CF4892C1AFEC9231E8D66CF8237B@PGSMSX111.gar.corp.intel.com> References: <1526395251-27894-1-git-send-email-wei.dai@intel.com> In-Reply-To: <1526395251-27894-1-git-send-email-wei.dai@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZDhmOGViZDAtOGNhOS00YWEwLTkxZmMtZWI5ODM3ZGMwZWRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImNtVVRWbzFlZHBUMk5jWnZpK0VJRVpGdEx3M2c4eFc1WU9lVURRSmZXaEU9In0= x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: timeout-no-action x-originating-ip: [172.30.20.205] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [PATCH] bus/pci: fix error in parsing vfio driver X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2018 15:10:09 -0000 Give up this patch as there is already a patch in http://dpdk.org/dev/patchwork/patch/40030/ bus/pci: correct the earlier = strlcpy conversion > -----Original Message----- > From: Dai, Wei > Sent: Tuesday, May 15, 2018 10:41 PM > To: Yigit, Ferruh ; Burakov, Anatoly > > Cc: dev@dpdk.org; Dai, Wei ; stable@dpdk.org > Subject: [PATCH] bus/pci: fix error in parsing vfio driver >=20 > In pci_get_kernel_driver_by_path(), the available memory size of dri_name > should be strlen(name + 1) + 1, not the size of the pointer (8 bytes), so > "vfio-pci" is truncated to "vfio-pc" > ended with number 0. > This patch fixes it. >=20 > Fixes: fe5f777b5383 ("bus/pci: replace strncpy by strlcpy") > Cc: stable@dpdk.org >=20 > Signed-off-by: Wei Dai > --- > drivers/bus/pci/linux/pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c in= dex > a73ee49..cc6b383 100644 > --- a/drivers/bus/pci/linux/pci.c > +++ b/drivers/bus/pci/linux/pci.c > @@ -54,7 +54,7 @@ pci_get_kernel_driver_by_path(const char *filename, > char *dri_name) >=20 > name =3D strrchr(path, '/'); > if (name) { > - strlcpy(dri_name, name + 1, sizeof(dri_name)); > + strlcpy(dri_name, name + 1, strlen(name + 1) + 1); > return 0; > } >=20 > -- > 2.5.5