Cédric Le Goater ed5b00a05c powerpc/prom: Fix "ibm,arch-vec-5-platform-support" scan
The "ibm,arch-vec-5-platform-support" property is a list of pairs of
bytes representing the options and values supported by the platform
firmware. At boot time, Linux scans this list and activates the
available features it recognizes : Radix and XIVE.

A recent change modified the number of entries to loop on and 8 bytes,
4 pairs of { options, values } entries are always scanned. This is
fine on KVM but not on PowerVM which can advertises less. As a
consequence on this platform, Linux reads extra entries pointing to
random data, interprets these as available features and tries to
activate them, leading to a firmware crash in
ibm,client-architecture-support.

Fix that by using the property length of "ibm,arch-vec-5-platform-support".

Fixes: ab91239942a9 ("powerpc/prom: Remove VLA in prom_check_platform_support()")
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210122075029.797013-1-clg@kaod.org
2021-01-31 22:35:48 +11:00
..
2020-08-07 18:48:15 -07:00
2020-12-09 23:48:14 +11:00
2020-10-16 12:21:15 -07:00
2020-12-09 23:48:14 +11:00
2020-12-04 01:01:09 +11:00
2021-01-30 11:39:29 +11:00
2020-10-08 21:17:12 +11:00
2020-07-27 00:01:30 +10:00
2020-06-05 12:39:30 -07:00
2020-06-05 12:39:30 -07:00
2021-01-31 22:35:48 +11:00
2020-12-05 21:49:52 +11:00
2020-12-05 21:49:52 +11:00
2020-12-17 13:34:25 -08:00
2020-12-17 13:34:25 -08:00
2020-11-18 14:18:09 -06:00
2020-12-04 01:01:19 +11:00
2020-12-17 13:34:25 -08:00