From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id A08CD47CE; Fri, 22 Sep 2017 15:23:14 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Sep 2017 06:23:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,427,1500966000"; d="scan'208";a="902909327" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by FMSMGA003.fm.intel.com with ESMTP; 22 Sep 2017 06:23:12 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by irsmsx110.ger.corp.intel.com ([163.33.3.25]) with mapi id 14.03.0319.002; Fri, 22 Sep 2017 14:23:11 +0100 From: "Jastrzebski, MichalX K" To: "Jastrzebski, MichalX K" , "yliu@fridaylinux.org" , "maxime.coquelin@redhat.com" CC: "dev@dpdk.org" , "Jain, Deepak K" , "Piasecki, JacekX" , "Liu, Changpeng" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] examples/vhost_scsi: fix buffer not terminated Thread-Index: AQHTM6P3UXIs/oro6kuyKvRj9t6IxqLA5Gtg Date: Fri, 22 Sep 2017 13:23:10 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C3E24F@IRSMSX109.ger.corp.intel.com> References: <20170922130819.5948-1-michalx.k.jastrzebski@intel.com> In-Reply-To: <20170922130819.5948-1-michalx.k.jastrzebski@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTliYTNmZTMtMTY1OC00NTVhLTg2MDEtMDY4NjQyODNiMWEwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjMzbmtsdklMNnN5clNcL21LaHhTSng5ajFWR2NPVzJvQWdnSGdGbmw0elhvPSJ9 x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] examples/vhost_scsi: fix buffer not terminated 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: Fri, 22 Sep 2017 13:23:15 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Jastrzebski > Sent: Friday, September 22, 2017 3:08 PM > To: yliu@fridaylinux.org; maxime.coquelin@redhat.com > Cc: dev@dpdk.org; Jain, Deepak K ; Piasecki, > JacekX ; Liu, Changpeng > ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH] examples/vhost_scsi: fix buffer not terminate= d >=20 > From: Jacek Piasecki >=20 > Fix size of buffer in strcpy. There was possible to get > not terminated string after copy operation. >=20 > Coverity issue: 158631 > Fixes: db75c7af19bb ("examples/vhost_scsi: introduce a new sample app") > Cc: changpeng.liu@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Jacek Piasecki > --- > examples/vhost_scsi/scsi.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/examples/vhost_scsi/scsi.c b/examples/vhost_scsi/scsi.c > index 54d3104..de9639a 100644 > --- a/examples/vhost_scsi/scsi.c > +++ b/examples/vhost_scsi/scsi.c > @@ -307,7 +307,8 @@ > strncpy((char *)inqdata->t10_vendor_id, "INTEL", 8); >=20 > /* PRODUCT IDENTIFICATION */ > - strncpy((char *)inqdata->product_id, bdev->product_name, > 16); > + strncpy((char *)inqdata->product_id, bdev->product_name, > + ARRAY_SIZE(inqdata->product_id) - 1); >=20 > /* PRODUCT REVISION LEVEL */ > strncpy((char *)inqdata->product_rev, "0001", 4); > -- > 1.9.1 I am sorry, please ignore this mail - sent two times.