Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2679266pxj; Mon, 31 May 2021 08:05:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeSRmnkpD6KE9DmW1c36tyvRgOadXHN5ZaYB+iDJ9sPwQ4zdHiqcmok77FzjF1da/KnH0r X-Received: by 2002:a17:906:d967:: with SMTP id rp7mr9073436ejb.424.1622473544335; Mon, 31 May 2021 08:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622473544; cv=none; d=google.com; s=arc-20160816; b=NLpDDr2sD210incBsYKJYux9L3x975WZIJY/3to5EaUIarP1QogMFDPO3urxaQJ78T rXI/x5N0wL9XyblclSPXtAUwzMqYd12ZeBre2u1vfQ2SvfftCZxTafPvOw4bfztmqMHq W4HB9nertHP/sxYR1nYBnOYezBcZW93jHkI/wLBluhhawyBwKQk6SdjFhq7dNv/fgbP8 BfhcokmznUoB10fZBNEQBF3kKKN0YlyOr2ILlg/q8WwyxS0gTFGVjxRNvYEmbUGF8oef 2JOoxruCeUkNl3k+eL5pJuiEupJEemLhP+XTlQMqQ/GaAIV6kWlArCiA5GMe1+7j1v08 QJJw== 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=Y0FPVI5a++5euIRrulc2hdtQ82gSDQ8DNbYIMgGu0XQgu5iqgYfFdl6CIpvwN0LySU BKWY4gREBQSvZps9NYaBQyaXY9qWU1h3J9V7RtuzdfdshQEMzP0+++7hvxJdoAdXxENK fY5sHf0b7nLX82H4LUt0MG79mlz8re+qEfLxEIhYhTHdxMiTrWlFxqdpDI1S62vCeREg n4IzCMUJisJ1f/fB3mkNLD1C0Wa3i7ue9Btet4Sv4rLXoRBf9SU7XK0kvCakS5m2crDh 8LW8inGdyA7XKvurTYrZIUeas9dj/Tx53yq08VwrGxty3m5HV54J3ktdLUkGgaOwxuJY eyYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t5JaUHQI; 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 w10si14805054ejv.754.2021.05.31.08.05.21; Mon, 31 May 2021 08:05:44 -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=t5JaUHQI; 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 S232942AbhEaPGG (ORCPT + 99 others); Mon, 31 May 2021 11:06:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:40564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232894AbhEaOIB (ORCPT ); Mon, 31 May 2021 10:08:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6CB496145B; Mon, 31 May 2021 13:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468381; bh=rBrdI77HY/HSOdFz+fqOt2pQNvjFD10h6ks7goS58YE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t5JaUHQIRA+AFSnz1gvi+f9CiGHXFyrj0ZzUq9+ZjvoGPjvPppT3ueme5Jry03eHt uNrc4rl5hgLKljv9vqw+xcEEgoXE0C9E1hxySaR2wCv2H6FdnKrVsjTyJ9bYMDyRVk CqW30BuJ3tI0QRdOu9lv2jW1z5M3hjoXrghDh794= 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.10 220/252] gve: Correct SKB queue index validation. Date: Mon, 31 May 2021 15:14:45 +0200 Message-Id: <20210531130705.480272383@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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