]> git.baikalelectronics.ru Git - kernel.git/commit
platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl
authorTzung-Bi Shih <tzungbi@kernel.org>
Fri, 24 Mar 2023 01:06:58 +0000 (09:06 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Apr 2023 09:16:38 +0000 (11:16 +0200)
commitdc12875d0729e7b65ba6f3a4444675a61b263af2
treea542d176a632225ddf3ae7a5136e66f58300f4bc
parent8cc600746c7d188bb3995221f8c175b7d750af7f
platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl

[ Upstream commit b20cf3f89c56b5f6a38b7f76a8128bf9f291bbd3 ]

It is possible to peep kernel page's data by providing larger `insize`
in struct cros_ec_command[1] when invoking EC host commands.

Fix it by using zeroed memory.

[1]: https://elixir.bootlin.com/linux/v6.2/source/include/linux/platform_data/cros_ec_proto.h#L74

Fixes: 8c93ae858843 ("mfd / platform: cros_ec: Miscellaneous character device to talk with the EC")
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20230324010658.1082361-1-tzungbi@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/chrome/cros_ec_chardev.c