mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-28 01:45:45 +00:00
gve: DQO: Fix off by one in gve_rx_dqo()
The rx->dqo.buf_states[] array is allocated in gve_rx_alloc_ring_dqo()
and it has rx->dqo.num_buf_states so this > needs to >= to prevent an
out of bounds access.
Fixes: 9b8dd5e5ea
("gve: DQO: Add RX path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
66f1546dfd
commit
ecd89c02da
1 changed files with 1 additions and 1 deletions
|
@ -525,7 +525,7 @@ static int gve_rx_dqo(struct napi_struct *napi, struct gve_rx_ring *rx,
|
||||||
struct gve_priv *priv = rx->gve;
|
struct gve_priv *priv = rx->gve;
|
||||||
u16 buf_len;
|
u16 buf_len;
|
||||||
|
|
||||||
if (unlikely(buffer_id > rx->dqo.num_buf_states)) {
|
if (unlikely(buffer_id >= rx->dqo.num_buf_states)) {
|
||||||
net_err_ratelimited("%s: Invalid RX buffer_id=%u\n",
|
net_err_ratelimited("%s: Invalid RX buffer_id=%u\n",
|
||||||
priv->dev->name, buffer_id);
|
priv->dev->name, buffer_id);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue