Received: by 10.192.165.148 with SMTP id m20csp4747453imm; Tue, 1 May 2018 03:05:51 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr6Kapl+mEOHkWa46ij9ZmPKJnOXeTBFvbrqZtZGeyjW4zO0KaHKAUyzYq8PCCcWxkCy91t X-Received: by 2002:a17:902:784c:: with SMTP id e12-v6mr3785953pln.60.1525169151763; Tue, 01 May 2018 03:05:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525169151; cv=none; d=google.com; s=arc-20160816; b=Ni4O+hRm88b7KE16QV09syANH7jfP8vrLiT/iHNoHtCudD06CP2DQ7K/4a7ag3qyuC 8RxkzzilXIdWWxHOW2uRpkUUscsrJztqScKZzCHdmMFcn/uxUIEcW1vyjpDKmx0F1LGF +Q4g5dD+FAeb6rdDcnhfgU1Y9B9V4zJnJqeBT6GgcNyyCo6ln3RaYNeLSl3VuDEQFy7r ti4fopo2A82wNJUs0s+LC8paE5y4eLYYCjRmTMCcb4gkpXdN2D1vQecDuUHlCKdPpLaQ iYYx05f3o7/SZpFmdEqyldewzBmALP+bXk1dAhG2wfwXElawf/VyL8vNLO+8V30peS8z D1kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=gYEjQjFUPzGBoMLpcoop7dlKkVoKMw9qw0uN0eA9+9s=; b=AOrXewKNoj/Lq+Zl4YhhqC91taIjEb8DdbFYTEAmetomenCbdCwLz+e/G6HPbeBHho 5B1INDC68yS/bEZs02Wt6SAjRMFiFOxF2BSDLVHWpNvKySeKRHjuiBYpfV5LH119ET4k mxm0xL3vzcdLv2kR/e9pMRy4FCxctCyD9OjNftBGliL6Ql+RWmlKG3qFdYfcJg6MPvyQ nq9sIfbCGFDLdRm0IGHwu8t5nwXog6ncX2Yz7tstc6rjBIBScP7rdruJDQk36FC92ubz 8KQD5i6dc/wFFlMHzj4KL2LGmPvKvdIppBgRpksN//X9ccm5Cf/fkN8fAHzTaodeMC9J 425g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9-v6si2600790pgu.27.2018.05.01.03.05.37; Tue, 01 May 2018 03:05:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753545AbeEAKFU (ORCPT + 99 others); Tue, 1 May 2018 06:05:20 -0400 Received: from smtp03.citrix.com ([162.221.156.55]:46280 "EHLO SMTP03.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751658AbeEAKFS (ORCPT ); Tue, 1 May 2018 06:05:18 -0400 X-IronPort-AV: E=Sophos;i="5.49,350,1520899200"; d="scan'208";a="53323911" Date: Tue, 1 May 2018 11:05:16 +0100 From: Wei Liu To: Marek =?iso-8859-1?Q?Marczykowski-G=F3recki?= CC: , Juergen Gross , "open list:NETWORKING DRIVERS" , , open list , Boris Ostrovsky , Wei Liu Subject: Re: [Xen-devel] [PATCH 4/6] xen-netfront: add range check for Tx response id Message-ID: <20180501100516.vjhop37we2rcrvyo@citrix.com> References: <960c6d6300fd3450ae9fb1de1c412bef7dbae992.1525122026.git-series.marmarek@invisiblethingslab.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <960c6d6300fd3450ae9fb1de1c412bef7dbae992.1525122026.git-series.marmarek@invisiblethingslab.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 30, 2018 at 11:01:48PM +0200, Marek Marczykowski-G?recki wrote: > Tx response ID is fetched from shared page, so make sure it is sane > before using it as an array index. > > CC: stable@vger.kernel.org > Signed-off-by: Marek Marczykowski-G?recki > --- > drivers/net/xen-netfront.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c > index 934b8a4..55c9b25 100644 > --- a/drivers/net/xen-netfront.c > +++ b/drivers/net/xen-netfront.c > @@ -394,6 +394,7 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue) > continue; > > id = txrsp.id; > + BUG_ON(id >= NET_TX_RING_SIZE); It is better to use ARRAY_SIZE here. Wei.