linux/drivers/hwtracing/stm
Alexander Shishkin 51e0f22781 stm class: Fix channel bitmap on 32-bit systems
Commit 7bd1d4093c ("stm class: Introduce an abstraction for System Trace
Module devices") naively calculates the channel bitmap size in 64-bit
chunks regardless of the size of underlying unsigned long, making the
bitmap half as big on a 32-bit system. This leads to an out of bounds
access with the upper half of the bitmap.

Fix this by using BITS_TO_LONGS. While at it, convert to using
struct_size() for the total size calculation of the master struct.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: 7bd1d4093c ("stm class: Introduce an abstraction for System Trace Module devices")
Reported-by: Mulu He <muluhe@codeaurora.org>
Cc: stable@vger.kernel.org # v4.4+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25 11:31:17 +02:00
..
Kconfig stm class: Add MIPI SyS-T protocol support 2018-10-11 12:12:54 +02:00
Makefile stm class: Add MIPI SyS-T protocol support 2018-10-11 12:12:54 +02:00
console.c
core.c stm class: Fix channel bitmap on 32-bit systems 2019-04-25 11:31:17 +02:00
dummy_stm.c stm class: Make dummy's master/channel ranges configurable 2018-03-28 18:47:18 +03:00
ftrace.c coresight: Moving framework and drivers to SPDX identifier 2018-05-14 16:19:59 +02:00
heartbeat.c stm class: heartbeat: Fix whitespace 2018-10-11 12:12:55 +02:00
p_basic.c stm class: Factor out default framing protocol 2018-10-11 12:12:54 +02:00
p_sys-t.c stm class: p_sys-t: Add support for CLOCKSYNC packets 2018-10-11 12:12:54 +02:00
policy.c stm class: Fix a module refcount leak in policy creation error path 2018-12-19 20:21:06 +01:00
stm.h stm class: Add a helper for writing data packets 2018-10-11 12:12:54 +02:00