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 8CE4E1B21C; Mon, 2 Oct 2017 15:53:13 +0200 (CEST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2017 06:53:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,469,1500966000"; d="scan'208";a="157848792" Received: from irsmsx152.ger.corp.intel.com ([163.33.192.66]) by fmsmga005.fm.intel.com with ESMTP; 02 Oct 2017 06:53:07 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX152.ger.corp.intel.com (163.33.192.66) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 2 Oct 2017 14:53:05 +0100 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by irsmsx112.ger.corp.intel.com ([169.254.1.142]) with mapi id 14.03.0319.002; Mon, 2 Oct 2017 14:53:04 +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: AQHTM6QwwPrJmUI1p060yd/HhG7ZE6LQpB4w Date: Mon, 2 Oct 2017 13:53:03 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C40F2A@IRSMSX109.ger.corp.intel.com> References: <20170922130959.13484-1-michalx.k.jastrzebski@intel.com> In-Reply-To: <20170922130959.13484-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjMwNzRlY2ItNWI0Mi00NDYzLWFkNzEtYmI3NGFhMjVmYWUxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6Ijhsc2J6ckRITU81YnliWDRWV2xLblphXC9jOHFKZVpoVEVmOHdEZENZNTlnPSJ9 x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] examples/vhost_scsi: fix buffer not terminated X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Oct 2017 13:53:14 -0000 > -----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 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: 158629 > 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/vhost_scsi.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > 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; >=20 > - 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 Hi Yu / Maxime, I would like to ask for a feedback regarding proposed fix. If everything is ok with it, please send acked-by. Best regards Michal.