linux-stable/drivers/base
Peng Fan 1f850ba16f regmap: debugfs: check count when read regmap file
commit 74edd08a4f upstream.

When executing the following command, we met kernel dump.
dmesg -c > /dev/null; cd /sys;
for i in `ls /sys/kernel/debug/regmap/* -d`; do
	echo "Checking regmap in $i";
	cat $i/registers;
done && grep -ri "0x02d0" *;

It is because the count value is too big, and kmalloc fails. So add an
upper bound check to allow max size `PAGE_SIZE << (MAX_ORDER - 1)`.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-07-31 16:44:45 +02:00
..
power PM: core: Fix handling of devices deleted during system-wide resume 2020-02-14 16:32:13 -05:00
regmap regmap: debugfs: check count when read regmap file 2020-07-31 16:44:45 +02:00
test License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
arch_topology.c arch_topology: Fix section miss match warning due to free_raw_capacity() 2020-04-24 08:01:03 +02:00
attribute_container.c
base.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bus.c kobject: return error code if writing /sys/.../uevent fails 2019-02-12 19:46:02 +01:00
cacheinfo.c drivers: base: cacheinfo: Ensure cpu hotplug work is done before Intel RDT 2019-07-21 09:04:16 +02:00
class.c
component.c component: Silence bind error on -EPROBE_DEFER 2020-05-27 16:42:57 +02:00
container.c
core.c driver core: Do not resume suppliers under device_links_write_lock() 2020-01-27 14:46:15 +01:00
cpu.c x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation 2020-06-11 09:23:01 +02:00
dd.c driver core: Print device when resources present in really_probe() 2020-02-28 16:36:04 +01:00
devcoredump.c
devres.c devres: Align data[] to ARCH_KMALLOC_MINALIGN 2019-05-16 19:42:29 +02:00
devtmpfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma-coherent.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dma-contiguous.c
dma-mapping.c
driver.c
firmware.c
firmware_class.c Revert "firmware: add sanity check on shutdown/suspend" 2017-09-10 21:19:06 -07:00
hypervisor.c
init.c
isa.c isa: Prevent NULL dereference in isa_bus driver callbacks 2017-12-14 09:52:51 +01:00
Kconfig dma-buf/fence: Fix lock inversion within dma-fence-array 2018-03-19 08:42:47 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
map.c
memory.c mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock 2019-12-01 09:14:14 +01:00
module.c
node.c mm: hide incomplete nr_indirectly_reclaimable in sysfs 2019-04-20 09:15:10 +02:00
pinctrl.c
platform-msi.c platform-msi: Free descriptors in platform_msi_domain_free() 2019-01-09 17:14:48 +01:00
platform.c drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish 2020-06-25 15:41:51 +02:00
property.c ACPI: properties: Align return codes of __acpi_node_get_property_reference() 2017-10-11 21:15:44 +02:00
soc.c base: soc: Export soc_device_register/unregister APIs 2019-10-05 12:47:47 +02:00
syscore.c
topology.c
transport_class.c