OSDN Git Service

intel_th: Fix resource handling for ACPI glue layer
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 18 Sep 2018 13:10:48 +0000 (16:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:18 +0000 (16:59 -0700)
commit825e12a2ed63cb166648a03d0a83f15e8ebc2760
treec43469d53b597d9e2120881147d7e99ca58582d9
parentc3b92e93b23a1b6fed026acc39a8fef715bb9e4e
intel_th: Fix resource handling for ACPI glue layer

commit ebe4582281d6e90972f057318a6edea14810ea48 upstream.

The core of the driver expects the resource array from the glue layer
to be indexed by even numbers, as is the case for 64-bit PCI resources.
This doesn't hold true for others, ACPI in this instance, which leads
to an out-of-bounds access and an ioremap() on whatever address that
access fetches.

This patch fixes the problem by reading resource array differently based
on whether the 64-bit flag is set, which would indicate PCI glue layer.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: ebc57e399b8e ("intel_th: Add ACPI glue layer")
CC: stable@vger.kernel.org # v4.17+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/intel_th/core.c