Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1071381ybl; Wed, 14 Aug 2019 10:13:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFH3/T4mt8V1o601St724aWt5+WepwqO4y7nfE2W7Y34VUqAy0r+MRhtnBz8FKwIzuqGnB X-Received: by 2002:a63:5f09:: with SMTP id t9mr176127pgb.351.1565802837492; Wed, 14 Aug 2019 10:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565802837; cv=none; d=google.com; s=arc-20160816; b=rWPeW3DQMXb/wNrEsrcLLyAlXBVPabnoaAXcLeQitHjJOQCrk2D4v31dVzoWKhFQUO XQbckYor63vIagr7OlKujnfFVMr/rCu30Ba+ay78V+DNoVbDHhugH7NFX6uuYcaoVwnt D+T5QISb0ZPFwu2My7PnTbTGPDO3unoVguT97eNi9qGjGzwqm1HYZ9TRBdosSkgY7JQy xFqGh7Y9WwpJxHGKWEhcJ5KQ78BvnVp8mYwNSjsJTdBDd0b+PREE2W6ygjyzeyiKZ6Wl bnfOjaPQjsge0+whk9gmBdd8bGzLCn0H47axz3HzHK7BRUMXqNUWzyldAsyDX3TQ//2n MNEw== 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=MRLqDtn+mL4mPskB/91iA8LKIjP4UpunrG4zXk8bE3A=; b=0SoDjFI7PNpyk9cMCjYE8eLCYA7QFfm+21FVOxos9Af1eAmdUkki9nfjInDO430uJo ih9KHjoBmtDDO3xC9KGHCLDrzebUay62p3o6BvVgxxr5Fvmpd5WuKYEXGwFisjAvl0d6 D970zqLqOEuFa/YQYMdaNWcPe8mieqAErx2DyvR7srYnsByt4ZaCslDgIgjymMK6gfG4 CXFmwLSpYu8+5x95HaAttAUHMVw1vl6omTXDwsNZE6b441rMESUbTI9+KAG37lTsCWZb mx7pv7qugJJve1kC+/gVPV1DGSZKJavM+pCwqoHOxsbiczKTRzaa4u6D9zG0+0VVKSMg pdyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xDNqTyi7; 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 y63si167950pgd.403.2019.08.14.10.13.41; Wed, 14 Aug 2019 10:13:57 -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=xDNqTyi7; 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 S1730659AbfHNRL5 (ORCPT + 99 others); Wed, 14 Aug 2019 13:11:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:35496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730648AbfHNRL4 (ORCPT ); Wed, 14 Aug 2019 13:11:56 -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 408F12173B; Wed, 14 Aug 2019 17:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802715; bh=BdE+cBTP0oWpSam2vBk6L+Z5ww9Qpan2cXxQwsOx9Rc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xDNqTyi7xR46clp63F4dcP5uuJzVQlFdET1ZCY8HO+KDiTyNJz3BFtmcYxE0jfK0b Em9XUTlRuA6wLP/omL5QKN/vy6bP9BCfigopLM61r7O94X8HkBDcEZ4lnDpXLL9sd3 yVShUJ1gIwlaP8Fxg/cElIR/ZQE327+fmGoUvJjg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emmanuel Grumbach , Johannes Berg Subject: [PATCH 4.19 89/91] iwlwifi: mvm: fix an out-of-bound access Date: Wed, 14 Aug 2019 19:01:52 +0200 Message-Id: <20190814165753.986012528@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165748.991235624@linuxfoundation.org> References: <20190814165748.991235624@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 From: Emmanuel Grumbach commit ba3224db78034435e9ff0247277cce7c7bb1756c upstream. The index for the elements of the ACPI object we dereference was static. This means that if we called the function twice we wouldn't start from 3 again, but rather from the latest index we reached in the previous call. This was dutifully reported by KASAN. Fix this. Cc: stable@vger.kernel.org Fixes: 6996490501ed ("iwlwifi: mvm: add support for EWRD (Dynamic SAR) ACPI table") Signed-off-by: Emmanuel Grumbach Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -724,7 +724,7 @@ static int iwl_mvm_sar_get_ewrd_table(st for (i = 0; i < n_profiles; i++) { /* the tables start at element 3 */ - static int pos = 3; + int pos = 3; /* The EWRD profiles officially go from 2 to 4, but we * save them in sar_profiles[1-3] (because we don't