Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3822411ybi; Mon, 29 Jul 2019 13:18:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQrUUoU9glsQFZhqcohhBDQXxlKaFbeYVxhZK48vXqhdpY9XR9fH/A+pbzcwrl5oyygVZU X-Received: by 2002:a62:7552:: with SMTP id q79mr38550869pfc.71.1564431498401; Mon, 29 Jul 2019 13:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564431498; cv=none; d=google.com; s=arc-20160816; b=oQn4X9mCxyTp9SbTcRnrDL14nirs2A8OETq88DdB/HWBEckGL3i18/H2tvuYdPFFOE RSwBt16EYkX9o6pBiYDs/cE02mpSsGK4scccSFr9pB6+nTOX+0TdMlZlrsw/WxVaHHzw byyIvVS1VJWTIzAngJ6oV7a0PfK/6tSkilTrmoKvpKXLIBd07bO2xPfXquqA/FSy9skA dCkzzL27WfyCn9pd24m9oUloeiyYtp47tFFHZmyNCZ2fV/uhEOy27N6/XE5aXG5bJStb l/fNhkHw4xK9m5VQ7Vq6k2gRlUNZ7A/UJephyCRAs7nLreCdXnEGoZe2Huo+CAw/VpYJ 8VhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZNsGDek2tteoilKGiH2y44tfnez+T+LkYVDqbiwyDXw=; b=MPi9bDZfVo2KxhZgen3dLA5jLmIYJEJ3iSmn9MmmzCo/yl9EmW/1tl0GlXvL31hNRJ MPjmvPI/jLcMC+KpGhyycThQVttvx1p+YeZ7Oceas1TdZPQxpxt7dCVmA4xqjbE4t50v p/3x+hXjqRgvujJhQb2WRQvcOk7voXipTEipDA34FLXaKvQwhL1I7AQGq1RxHsKRhYxP YqLlDrpEPZOxLFzbLP9iwebXtHrw289YJKLOy2VpcHnTcv95kWu6uJvJjjfd3G3NCCEp duN9FpGRJuj08zAl3lqYFNVATop0qMA44rzMP1D6rEhARuMIjxymGPqhFS6sjSBjJM7v 3wGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1+uB1y0U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si28322350plb.41.2019.07.29.13.18.03; Mon, 29 Jul 2019 13:18:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1+uB1y0U; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728663AbfG2UQU (ORCPT + 99 others); Mon, 29 Jul 2019 16:16:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:36552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387988AbfG2TYU (ORCPT ); Mon, 29 Jul 2019 15:24:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C675A216C8; Mon, 29 Jul 2019 19:24:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428259; bh=t7Di/nW8zHaZ4oltp5kAHKlaau4jSGhr1gABisjElM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1+uB1y0UBVlFQcVZj1zaqEAqPvLU9Oh/HzVZdNIzmfGgkfqyEe+c4y29kRR9AlQ4R dOS9xTEWG/chhucBHjhD2YeE3MERQk7Ax+BCC6qlWZfa5WexiBHHJqB+CjcnT0FBMJ RTdb29ycDDnD9fDT2/5khazVGPJ+41X9Pn1XOtvA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Gustavo A. R. Silva" , Maya Erez , Kalle Valo , Sasha Levin Subject: [PATCH 4.14 006/293] wil6210: fix potential out-of-bounds read Date: Mon, 29 Jul 2019 21:18:17 +0200 Message-Id: <20190729190820.822625516@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit bfabdd6997323adbedccb13a3fed1967fb8cf8f5 ] Notice that *rc* can evaluate to up to 5, include/linux/netdevice.h: enum gro_result { GRO_MERGED, GRO_MERGED_FREE, GRO_HELD, GRO_NORMAL, GRO_DROP, GRO_CONSUMED, }; typedef enum gro_result gro_result_t; In case *rc* evaluates to 5, we end up having an out-of-bounds read at drivers/net/wireless/ath/wil6210/txrx.c:821: wil_dbg_txrx(wil, "Rx complete %d bytes => %s\n", len, gro_res_str[rc]); Fix this by adding element "GRO_CONSUMED" to array gro_res_str. Addresses-Coverity-ID: 1444666 ("Out-of-bounds read") Fixes: 194b482b5055 ("wil6210: Debug print GRO Rx result") Signed-off-by: Gustavo A. R. Silva Reviewed-by: Maya Erez Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/wil6210/txrx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 389c718cd257..16750056b8b5 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -732,6 +732,7 @@ void wil_netif_rx_any(struct sk_buff *skb, struct net_device *ndev) [GRO_HELD] = "GRO_HELD", [GRO_NORMAL] = "GRO_NORMAL", [GRO_DROP] = "GRO_DROP", + [GRO_CONSUMED] = "GRO_CONSUMED", }; if (ndev->features & NETIF_F_RXHASH) -- 2.20.1