From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id BB95D199A9; Wed, 11 Oct 2017 15:45:23 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2017 06:45:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,361,1503385200"; d="scan'208";a="1180913154" Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga001.jf.intel.com with ESMTP; 11 Oct 2017 06:45:19 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by IRSMSX108.ger.corp.intel.com ([169.254.11.167]) with mapi id 14.03.0319.002; Wed, 11 Oct 2017 14:45:19 +0100 From: "Jastrzebski, MichalX K" To: "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: AQHTM6QwwPrJmUI1p060yd/HhG7ZE6LQpB4wgA4idMA= Date: Wed, 11 Oct 2017 13:45:18 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C457A0@IRSMSX109.ger.corp.intel.com> References: <20170922130959.13484-1-michalx.k.jastrzebski@intel.com> <60ABE07DBB3A454EB7FAD707B4BB158213C40F2A@IRSMSX109.ger.corp.intel.com> In-Reply-To: <60ABE07DBB3A454EB7FAD707B4BB158213C40F2A@IRSMSX109.ger.corp.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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjMwNzRlY2ItNWI0Mi00NDYzLWFkNzEtYmI3NGFhMjVmYWUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ijhsc2J6ckRITU81YnliWDRWV2xLblphXC9jOHFKZVpoVEVmOHdEZENZNTlnPSJ9 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: Wed, 11 Oct 2017 13:45:24 -0000 > -----Original Message----- > From: Jastrzebski, MichalX K > Sent: Monday, October 2, 2017 3:53 PM > 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 > Subject: RE: [dpdk-dev] [PATCH] examples/vhost_scsi: fix buffer not > terminated >=20 > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal > Jastrzebski > > Sent: Friday, September 22, 2017 3:10 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 > terminated > > > > From: Jacek Piasecki > > > > Fix size of buffer in strcpy. There was possible to get > > not terminated string after copy operation. > > > > Coverity issue: 158629 > > Fixes: db75c7af19bb ("examples/vhost_scsi: introduce a new sample > app") > > Cc: changpeng.liu@intel.com > > Cc: stable@dpdk.org > > > > Signed-off-by: Jacek Piasecki > > --- > > examples/vhost_scsi/vhost_scsi.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/examples/vhost_scsi/vhost_scsi.c > > b/examples/vhost_scsi/vhost_scsi.c > > index b4f1f8d..b1a8c93 100644 > > --- a/examples/vhost_scsi/vhost_scsi.c > > +++ b/examples/vhost_scsi/vhost_scsi.c > > @@ -186,8 +186,9 @@ static uint64_t gpa_to_vva(int vid, uint64_t gpa) > > if (!bdev) > > return NULL; > > > > - strncpy(bdev->name, bdev_name, sizeof(bdev->name)); > > - strncpy(bdev->product_name, bdev_serial, sizeof(bdev- > > >product_name)); > > + strncpy(bdev->name, bdev_name, sizeof(bdev->name) - 1); > > + strncpy(bdev->product_name, bdev_serial, > > + sizeof(bdev->product_name) - 1); > > bdev->blocklen =3D blk_size; > > bdev->blockcnt =3D blk_cnt; > > bdev->write_cache =3D wce_enable; > > -- > > 1.9.1 >=20 > Hi Yu / Maxime, > I would like to ask for a feedback regarding proposed fix. > If everything is ok with it, please send acked-by. >=20 > Best regards > Michal. Acked-by: Michal Jastrzebski