From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 22D821B21D; Mon, 2 Oct 2017 15:51:00 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2017 06:51:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,469,1500966000"; d="scan'208";a="318552904" Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by fmsmga004.fm.intel.com with ESMTP; 02 Oct 2017 06:50:58 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by IRSMSX104.ger.corp.intel.com ([163.33.3.159]) with mapi id 14.03.0319.002; Mon, 2 Oct 2017 14:50:58 +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: AQHTM6PmnAelxUjVHEeHwKwk+FrPgqLQoxyw Date: Mon, 2 Oct 2017 13:50:56 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C40F16@IRSMSX109.ger.corp.intel.com> References: <20170922130734.7256-1-michalx.k.jastrzebski@intel.com> In-Reply-To: <20170922130734.7256-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: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGFmOWU4ODItMjRlNC00NmY1LTkwMGUtYWIwN2Q3NzUxYTEwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IjEwaWZJRzFSWGxaV2dmY29iQjVlWjZDYWFIQWRUZlg2dDZENW1yQzVVTEE9In0= 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-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: Mon, 02 Oct 2017 13:51:01 -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 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.