WSL2-Linux-Kernel/drivers/platform/olpc
Dan Carpenter 40ec787e1a platform/olpc: Fix uninitialized data in debugfs write
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>
2022-07-28 20:40:15 +02:00
..
Kconfig Platform: OLPC: Add a config menu category for XO 1.75 2019-06-12 11:53:20 +03:00
Makefile platform-drivers-x86 for v5.3-1 2019-07-14 16:51:47 -07:00
olpc-ec.c platform/olpc: Fix uninitialized data in debugfs write 2022-07-28 20:40:15 +02:00
olpc-xo175-ec.c spi: make remove callback a void function 2022-02-09 13:00:45 +00:00