Alexander Shishkin 51e0f22781 stm class: Fix channel bitmap on 32-bit systems
Commit 7bd1d4093c2f ("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: 7bd1d4093c2f ("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
..
2019-04-15 16:48:51 -07:00
2019-03-06 09:41:12 -08:00
2019-03-16 13:05:32 -07:00
2019-03-29 03:04:47 +01:00
2019-03-10 11:54:48 -07:00
2019-03-10 10:17:23 -07:00
2019-04-25 11:27:48 +02:00
2019-03-14 09:00:06 -07:00
2019-04-20 12:52:23 -07:00
2019-03-09 14:57:08 -08:00
2019-03-16 12:51:50 -07:00
2019-03-06 09:41:12 -08:00
2019-03-29 15:31:16 +01:00
2019-04-10 22:45:38 -07:00
2019-03-15 14:22:59 -07:00
2019-03-11 11:22:15 -07:00
2019-04-07 06:12:10 -10:00
2019-03-10 12:29:52 -07:00