From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F307CA04C2; Mon, 25 Nov 2019 17:23:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 530BE2952; Mon, 25 Nov 2019 17:23:25 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 719D5A3 for ; Mon, 25 Nov 2019 17:23:23 +0100 (CET) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Nov 2019 08:23:22 -0800 X-IronPort-AV: E=Sophos;i="5.69,242,1571727600"; d="scan'208";a="202410177" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.46]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 25 Nov 2019 08:23:18 -0800 Date: Mon, 25 Nov 2019 16:23:16 +0000 From: Bruce Richardson To: dev@dpdk.org Message-ID: <20191125162316.GA1615@bricha3-MOBL.ger.corp.intel.com> References: <20191125152303.68461-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191125152303.68461-1-bruce.richardson@intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) Subject: Re: [dpdk-dev] [PATCH] examples/ioat: handle failure case for ioat dequeue 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, Nov 25, 2019 at 03:23:03PM +0000, Bruce Richardson wrote: > On a failure with the ioat dequeue, -1 is returned, which was not properly > handled. This could lead to out-of-bounds reads on a later loop which > assumed a positive return value. Fix this by treating an error as though a > dequeue of 0 had been encountered. > > Coverity issue: 350342 FYI: also should fix issue: 350349 > Fixes: 2328542ed84e ("examples/ioat: add rawdev copy mode") > > Signed-off-by: Bruce Richardson > --- > examples/ioat/ioatfwd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c > index 5e623a4d5..9fc033bc3 100644 > --- a/examples/ioat/ioatfwd.c > +++ b/examples/ioat/ioatfwd.c > @@ -457,7 +457,7 @@ ioat_tx_port(struct rxtx_port_config *tx_config) > MAX_PKT_BURST, NULL); > } > > - if (nb_dq == 0) > + if (nb_dq <= 0) > return; > > if (copy_mode == COPY_MODE_IOAT_NUM) > -- > 2.21.0 >