linux/drivers/base/regmap
Peng Fan 59242fa1d2 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 18:39:32 +02:00
..
Kconfig
Makefile
internal.h
regcache-flat.c
regcache-lzo.c
regcache-rbtree.c
regcache.c
regmap-ac97.c
regmap-debugfs.c regmap: debugfs: check count when read regmap file 2020-07-31 18:39:32 +02:00
regmap-i2c.c
regmap-i3c.c
regmap-irq.c
regmap-mmio.c
regmap-sccb.c
regmap-sdw.c
regmap-slimbus.c
regmap-spi.c
regmap-spmi.c
regmap-w1.c
regmap.c regmap: dev_get_regmap_match(): fix string comparison 2020-07-29 10:18:37 +02:00
trace.h