]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: cros_ec: Fix the allocation size for cros_ec_command
authorYiyuan Guo <yguoaz@gmail.com>
Fri, 30 Jun 2023 14:37:19 +0000 (22:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Aug 2023 16:21:59 +0000 (18:21 +0200)
commit2df8ae1e42b8e2a9cb78e99af22e7bf44d38e9ed
tree171b656f150d44eb4b5699bc588093a9fe49091d
parenta7cedc2b76124eece96679214ab4639eaeee95a1
iio: cros_ec: Fix the allocation size for cros_ec_command

commit 8a4629055ef55177b5b63dab1ecce676bd8cccdd upstream.

The struct cros_ec_command contains several integer fields and a
trailing array. An allocation size neglecting the integer fields can
lead to buffer overrun.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Yiyuan Guo <yguoaz@gmail.com>
Fixes: 974e6f02e27e ("iio: cros_ec_sensors_core: Add common functions for the ChromeOS EC Sensor Hub.")
Link: https://lore.kernel.org/r/20230630143719.1513906-1-yguoaz@gmail.com
Cc: <Stable@vger.kerenl.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c