[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180501100516.vjhop37we2rcrvyo@citrix.com>
Date: Tue, 1 May 2018 11:05:16 +0100
From: Wei Liu <wei.liu2@...rix.com>
To: Marek Marczykowski-Górecki
<marmarek@...isiblethingslab.com>
CC: <xen-devel@...ts.xenproject.org>, Juergen Gross <jgross@...e.com>,
"open list:NETWORKING DRIVERS" <netdev@...r.kernel.org>,
<stable@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Wei Liu <wei.liu2@...rix.com>
Subject: Re: [Xen-devel] [PATCH 4/6] xen-netfront: add range check for Tx
response id
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@...r.kernel.org
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@...isiblethingslab.com>
> ---
> 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.
Powered by blists - more mailing lists