Skip to content

Commit

Permalink
gve: Correct SKB queue index validation.
Browse files Browse the repository at this point in the history
[ Upstream commit fbd4a28 ]

SKBs with skb_get_queue_mapping(skb) == tx_cfg.num_queues should also be
considered invalid.

Fixes: f5cedc8 ("gve: Add transmit and receive support")
Signed-off-by: David Awogbemila <awogbemila@google.com>
Acked-by: Willem de Brujin <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
DavMila authored and gregkh committed Jun 3, 2021
1 parent 48f4dde commit 8e534c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/google/gve/gve_tx.c
Expand Up @@ -482,7 +482,7 @@ netdev_tx_t gve_tx(struct sk_buff *skb, struct net_device *dev)
struct gve_tx_ring *tx;
int nsegs;

WARN(skb_get_queue_mapping(skb) > priv->tx_cfg.num_queues,
WARN(skb_get_queue_mapping(skb) >= priv->tx_cfg.num_queues,
"skb queue index out of range");
tx = &priv->tx[skb_get_queue_mapping(skb)];
if (unlikely(gve_maybe_stop_tx(tx, skb))) {
Expand Down

0 comments on commit 8e534c9

Please sign in to comment.