lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 18 Aug 2020 12:44:15 -0700
From:   David Awogbemila <>
Cc:     David Awogbemila <>
Subject: [PATCH net-next 16/18] gve: Also WARN for skb index equals num_queues.

The WARN condition currently checks if the skb's
queue_mapping is (strictly) greater than tx_cfg.num_queues.

queue_mapping == tx_cfg.num_queues should also be invalid
and trigger the WARNing.

Use WARN_ON_ONCE instead otherwise the host will be stuck in syslog

Signed-off-by: David Awogbemila <>
 drivers/net/ethernet/google/gve/gve_tx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/google/gve/gve_tx.c b/drivers/net/ethernet/google/gve/gve_tx.c
index 5d75dec1c520..5beff4d4d2e3 100644
--- a/drivers/net/ethernet/google/gve/gve_tx.c
+++ b/drivers/net/ethernet/google/gve/gve_tx.c
@@ -602,8 +602,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,
-	     "skb queue index out of range");
+	WARN_ON_ONCE(skb_get_queue_mapping(skb) >= priv->tx_cfg.num_queues);
 	tx = &priv->tx[skb_get_queue_mapping(skb)];
 	if (unlikely(gve_maybe_stop_tx(tx, skb))) {
 		/* We need to ring the txq doorbell -- we have stopped the Tx

Powered by blists - more mailing lists