platform/chrome: fix memory corruption in ioctl
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 19 Aug 2022 05:20:36 +0000 (08:20 +0300)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 22 Aug 2022 06:56:45 +0000 (06:56 +0000)
commit8a07b45fd3c2dda24fad43639be5335a4595196a
tree316b17ad4b9ece0d4aa10d59bec0ce4ce94cb2be
parent6ad4194d6a1e1d11b285989cd648ef695b4a93c0
platform/chrome: fix memory corruption in ioctl

If "s_mem.bytes" is larger than the buffer size it leads to memory
corruption.

Fixes: eda2e30c6684 ("mfd / platform: cros_ec: Miscellaneous character device to talk with the EC")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/Yv8dpCFZJdbUT5ye@kili
drivers/platform/chrome/cros_ec_chardev.c