linux-stable/drivers/platform
Dan Carpenter 5a26833181 platform/olpc: Fix uninitialized data in debugfs write
[ Upstream commit 40ec787e1a ]

The call to:

	size = simple_write_to_buffer(cmdbuf, sizeof(cmdbuf), ppos, buf, size);

will succeed if at least one byte is written to the "cmdbuf" buffer.
The "*ppos" value controls which byte is written.  Another problem is
that this code does not check for errors so it's possible for the entire
buffer to be uninitialized.

Inintialize the struct to zero to prevent reading uninitialized stack
data.

Debugfs is normally only writable by root so the impact of this bug is
very minimal.

Fixes: 6cca83d498 ("Platform: OLPC: move debugfs support from x86 EC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YthIKn+TfZSZMEcM@kili
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:41:54 +02:00
..
chrome platform/chrome: cros_ec: Always expose last resume result 2022-08-17 14:41:23 +02:00
goldfish platform: goldfish: pipe: Use platform_get_irq() to get the interrupt 2022-03-18 13:55:21 +01:00
mellanox platform/mellanox: mlxreg-lc: Fix error flow and extend verbosity 2022-08-17 14:41:54 +02:00
mips MIPS: Loongson-3: fix compile mips cpu_hwmon as module build error. 2022-06-22 14:27:55 +02:00
olpc platform/olpc: Fix uninitialized data in debugfs write 2022-08-17 14:41:54 +02:00
surface platform/surface: aggregator: Fix initialization order when compiling as builtin module 2022-05-06 13:05:57 +02:00
x86 platform/x86: pmc_atom: Match all Lex BayTrail boards with critclk_systems DMI table 2022-08-17 14:41:54 +02:00
Kconfig
Makefile