UPSTREAM: platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl

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.


Fixes: eda2e30c6684 ("mfd / platform: cros_ec: Miscellaneous character device to talk with the EC")
Signed-off-by: Tzung-Bi Shih <>
Reviewed-by: Guenter Roeck <>
(cherry picked from commit b20cf3f89c56b5f6a38b7f76a8128bf9f291bbd3)


Signed-off-by: Linux Patches Robot <>
Change-Id: I634988f102aa2b5165056a9ec533ba65659a318c
Commit-Queue: Gwendal Grignou <>
Reviewed-by: Benson Leung <>
Reviewed-by: Gwendal Grignou <>
Tested-by: Gwendal Grignou <>
1 file changed