iwlwifi: mvm: fix an out-of-bound access
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Mon, 22 Jul 2019 09:47:27 +0000 (12:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:12:53 +0000 (10:12 +0200)
commit80bac45e3ad88e026bbb80c4bd9c49fc50418003
tree2f7d764733abd79b6e1a52456f7c465b44d1a77b
parent7626b510fc77c6828a1989fd3d032597f934d347
iwlwifi: mvm: fix an out-of-bound access

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 <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/intel/iwlwifi/mvm/fw.c