cpu-topology: Fix the potential data corruption
commit4a33691c4cea9eb0a7c66e87248be4637e14b180
authorZeng Tao <prime.zeng@hisilicon.com>
Wed, 4 Mar 2020 03:54:52 +0000 (4 11:54 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 Mar 2020 08:08:45 +0000 (11 09:08 +0100)
tree6c918568bd2afd1595c2cf2dadce0872fa68cec5
parentb8fe128dad8f97cc9af7c55a264d1fc5ab677195
cpu-topology: Fix the potential data corruption

Currently there are only 10 bytes to store the cpu-topology 'name'
information. Only 10 bytes copied into cluster/thread/core names.

If the cluster ID exceeds 2-digit number, it will result in the data
corruption, and ending up in a dead loop in the parsing routines. The
same applies to the thread names with more that 3-digit number.

This issue was found using the boundary tests under virtualised
environment like QEMU.

Let us increase the buffer to fix such potential issues.

Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Zeng Tao <prime.zeng@hisilicon.com>
Link: https://lore.kernel.org/r/1583294092-5929-1-git-send-email-prime.zeng@hisilicon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/arch_topology.c