]> 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:00 +0000 (18:21 +0200)
commit0439ce5aefcd385db999f0d41ab1a2f892e2e6d3
treeb1ebd767fa9640ba0d6ea164c202a314d99253fe
parentaa425ee2278d0a3717f7885a2333d9c16a9407f6
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