Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1074660ybl; Wed, 14 Aug 2019 10:17:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXqd1Waq29KhOmTHQjUF/NWC5XMrcF7LaPA7VuBnpKgqMRnDxYzpp4cupaJQ3c2UGYNIYf X-Received: by 2002:a17:90a:a00d:: with SMTP id q13mr757615pjp.80.1565803021054; Wed, 14 Aug 2019 10:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565803021; cv=none; d=google.com; s=arc-20160816; b=VTG/T/cdhT1Gn5x0YbKFAsBEOASsZ2t5quX5cnmYa7jK2rTl4MhCatYmO1/uUjwbnY DG+zD1qGso/SQjsrPnpYwJVI+C0sH4YHME1XCHsDulImUVXzGc57tfLHbMyxAxa0Tgy3 MM2RCfKXS7g8he2Tvc7yJcCpbpXRRNmaJ9X1shtMY9fn+l3t45InLqRTftLD+6oKD8h2 Fk2WfNN0vXvpI8rwUGL6Fy3TM8CAzOi5AVWBOqBxO6KuoJ0PPCqvaKsWYlVeH4maMBKF juYJV0OqlevcKjDI9P0jAWMXJ9nk9nEhfKdVkXOim3LElRMBxUAbw0DMDzCrT59nfIdI NlUg== 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=K1Gzm3vj00LAeh7GQYrIsFOXyTXy9fvedfbnlD5RM6s=; b=jckeVLttZFWZ7az50qOGucQek7IDvFpfLUMa+2LxsBntntaL46tELdcP7C+ex++xFU gB1vpW4srOpNcUb9C9GUE4gsEmbqb38LP3eoxpSkDtDpTYG7hlIibVOEgRPWbdFn0RR3 MV+n8j2gVjsjKDhKVJaUcumDKh2+k/qXeB37vk2VX2wNulis4mofL3qV9oE4cqOf2kio cPydcmdFJ6mbfYiTaUtUQwwwScYLKfGIzofwETOBRAlT9iqYJ0sZFFDwiqUSDHchrSUw E265+Yyen23OmBEqTOmO/NvYuhQ11+YJ8iUoQcGlV4no1N83+BvLDuqjHJd5P0SwZ5Or 1SvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BDSEzdXq; 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 r139si62533pfc.276.2019.08.14.10.16.45; Wed, 14 Aug 2019 10:17:01 -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=BDSEzdXq; 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 S1731154AbfHNRO5 (ORCPT + 99 others); Wed, 14 Aug 2019 13:14:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:39398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731147AbfHNROz (ORCPT ); Wed, 14 Aug 2019 13:14:55 -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 F01862084D; Wed, 14 Aug 2019 17:14:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565802894; bh=341LqgKbRDC5iIKF4qSdeGtT563E6G4tGApkflHB3mc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BDSEzdXqoSfqzH8UjPJdSPAD5eWhNmWaTACvKED7ea1rYGAYtWuENlHSlfRIwMXIt 7lb1rcNYU2exk55HGPel1CwXNx215TSPQtBDB5s8tmawybwlOEQwUkRvWlP9Z32W2+ uBSgP/HFqSaQPNDVSJz/KgbtXhuoOMZYqtuNOZ+c= 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.14 67/69] iwlwifi: mvm: fix an out-of-bound access Date: Wed, 14 Aug 2019 19:02:05 +0200 Message-Id: <20190814165750.502514489@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190814165744.822314328@linuxfoundation.org> References: <20190814165744.822314328@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 @@ -778,7 +778,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