Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2711144pxj; Mon, 31 May 2021 08:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys17q7tpbCTyZJ+N/u6a+i2LvkUPcMZXB5FtduvM8SU/zW/noEvCjC66HukVtXvT1OqYO8 X-Received: by 2002:a02:caa9:: with SMTP id e9mr20716672jap.87.1622476225657; Mon, 31 May 2021 08:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622476225; cv=none; d=google.com; s=arc-20160816; b=uVHVExH8GlUObOR57TlwnhNLcBh9jeCqVqsXNdhiWLX6q2f4E3kOnOdiQWQx/2ic35 WQkdm+nobK+CHbs4J8h8FaVJBwTiDce6YrYe9fJjFFv02vcc7vVEjQ/qg6414AajVTJ3 po1LGehFvQHfbjy0z/0NZXKX5QWXQE/NxKeAr8VKTPBrVjslbTfGzzAvFrM0Cy+e5G5B e6a6JhqefGgjBvfyYY0kecqQPXGhnTI+bW7glecf3if22ZFcMtRAe038uBIec1ue4Pko C363DsVuo4c5uePWIg6OXnhcVlW0zwDCfTB5R5UXMhIA+igujegDEjdrWr7GAM1aQAc0 Megw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ao8hCURrSC3QcUGNI4vg7czqbS3KBDOoKPYQ/GeMb54=; b=p3BZvLOUtm5iXJPtDKiMV2IM2J0JFl0iJGe8qH5nJeD2PF+YyFLysv2nTkasX4g0sV CAL2QJ7Ko9CPbBe0bvojIEi0cE8nrEd4aqULnKYg9HWFmFRTyuCbTJajHKDxQ/9wyvx5 g7QQZBuNz56upP6ybVaqWQ6vMo2xaHkquHPNOu4HHDA92O4IrhQycSAwSedGEUAOxcjN tG6HIAtIIR4+q9DLCPdWow/fcMWZNV59dNguusWAx1rFNFwVwBYeCdMsIf0WHzIFFEb8 Jt3LoVRWtQMLOXQXA72MpASLIAjm5QRjFRljSe2jLMO8HpCq7+ZHTqm+5/yPKVFa4lzu lS0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XllP85OF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v14si3373456jas.70.2021.05.31.08.50.12; Mon, 31 May 2021 08:50:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XllP85OF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234193AbhEaPtm (ORCPT + 99 others); Mon, 31 May 2021 11:49:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:54710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232803AbhEaO1f (ORCPT ); Mon, 31 May 2021 10:27:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 72E5061613; Mon, 31 May 2021 13:47:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468864; bh=rBrdI77HY/HSOdFz+fqOt2pQNvjFD10h6ks7goS58YE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XllP85OFXgDsrSDu9rhEwXsdoha/XXTvVrBgHHYA+M57D6ygyJZoDCPdfisznyfNc eu2htMXZvgR5Iq+hzK5WDfT5SHFI0nI6SzF9gBW9cJ/OO96U81+4sldQMIWbw4ccrq 4bvS4GT1eyT5eLhGlzWBYTUcBYdovwYwLWqyi6dc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Awogbemila , Willem de Brujin , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 156/177] gve: Correct SKB queue index validation. Date: Mon, 31 May 2021 15:15:13 +0200 Message-Id: <20210531130653.309315771@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Awogbemila [ Upstream commit fbd4a28b4fa66faaa7f510c0adc531d37e0a7848 ] SKBs with skb_get_queue_mapping(skb) == tx_cfg.num_queues should also be considered invalid. Fixes: f5cedc84a30d ("gve: Add transmit and receive support") Signed-off-by: David Awogbemila Acked-by: Willem de Brujin Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/google/gve/gve_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/google/gve/gve_tx.c b/drivers/net/ethernet/google/gve/gve_tx.c index 30532ee28dd3..b653197b34d1 100644 --- a/drivers/net/ethernet/google/gve/gve_tx.c +++ b/drivers/net/ethernet/google/gve/gve_tx.c @@ -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))) { -- 2.30.2