Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9965252ybi; Wed, 24 Jul 2019 13:10:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDHdnINNz5J5RdnDPVtUzSyOGn2k6amD0OIJS97sqdUcTXiI8TfR6g9bC3S8+93BCwaPc4 X-Received: by 2002:a62:2c8e:: with SMTP id s136mr13166744pfs.3.1563999045185; Wed, 24 Jul 2019 13:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563999045; cv=none; d=google.com; s=arc-20160816; b=M5XvgbfuhmScZovAl6V8e4Nb4hDA+A7kZ87KB16QfvmFbQ+gXoKA0gIi0y6ErcQyGF o+C8wA1Fxix/NJCoHrUKaw8mtv3+PwHeUO17xX/1mEF8OAh+2Pgvm60Mm8jX8bc4Uzcn ipCVXSHjjfheehqCQTD8LBTljZ7xpB2rj/f95rJGVqynHk5EVLcDLQOWrzdXDxpJfXYx pTidzjYhQAc8w1It9hiH5hGSScv6DkLu1Q4Ieush1Kyc9pyfrGPFV08udIcaMJG5PEjS A4ETDIhtdqzi42IOF2+L0rnFvzj1A3aHH4RaHL6Bc/xMVrcnaFXX3XeBvZv7gDtc/Ogy Erpg== 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=9aKhf2bXjmiBb7ipZ8tjyl9yzdarH/eFmoTzAXk/lCE=; b=yMO9fFc0Fs5AVM/4fKeuFofu9efO8pRd3zhYLyMKjL+8pI8ejJHSWLrHxQFJ6JEDKg /RuKD1vBJlhNX8FVh4aa14HhQLze2qUCtayrZwQU/tMNO+1jkHw9V2nY2rbg5D0qZcE1 0nlYITO5prolGT269yaKU8ytcud+pHCqggBddxkk9TT/VQLl6vvsoTqoldxPXtz4gBQQ cEfRUAHQPfGJn0TzVmRBrvdbfzO6xnx2d42T+U1waRZXWdPP609ZkJ8oQwSK3zPbVfQK lOARWN9ekiBqAPlAFkt3bQy5Dd0GhxSfesbldcbr652tsMwOJlj91/VSxtiQmcj68QXs m56g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="bL05ZW3/"; 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 v141si19411468pgb.183.2019.07.24.13.10.30; Wed, 24 Jul 2019 13:10:45 -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="bL05ZW3/"; 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 S2405609AbfGXUCy (ORCPT + 99 others); Wed, 24 Jul 2019 16:02:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:52960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405258AbfGXUCx (ORCPT ); Wed, 24 Jul 2019 16:02:53 -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 DD57F20665; Wed, 24 Jul 2019 20:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998572; bh=RV0yo7X8cCLIszepIxIT7eB/zLRQsO2F0tprWbjM7BU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bL05ZW3/O1Drz5zeiRR/DtAuY52jBbVOoFSIjMrzgaTQIrEaEBQQklJZHozVx5GZx mpzy5VbsXupr8ee8+dojIuX1JqIhRn4nRf5xyOY0bCTp4c6zl7qvY0zUgqpo96h4QJ 5B+oNBEzCfx1ZNy96b+SyRHdKIoMzMkuzG+56gjA= 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.19 006/271] wil6210: fix potential out-of-bounds read Date: Wed, 24 Jul 2019 21:17:55 +0200 Message-Id: <20190724191655.813049445@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 75c8aa297107..1b1b58e0129a 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -736,6 +736,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", }; wil->txrx_ops.get_netif_rx_params(skb, &cid, &security); -- 2.20.1