]> git.itanic.dy.fi Git - linux-stable/commit
i2c: mlxbf: prevent stack overflow in mlxbf_i2c_smbus_start_transaction()
authorAsmaa Mnebhi <asmaa@nvidia.com>
Thu, 8 Sep 2022 17:35:39 +0000 (13:35 -0400)
committerWolfram Sang <wsa@kernel.org>
Sat, 17 Sep 2022 18:13:57 +0000 (20:13 +0200)
commitde24aceb07d426b6f1c59f33889d6a964770547b
treec5a1ef1b4fca0e7ca6a0a89ea7c67983bfe5f534
parent2a5be6d1340c0fefcee8a6489cff7fd88a0d5b85
i2c: mlxbf: prevent stack overflow in mlxbf_i2c_smbus_start_transaction()

memcpy() is called in a loop while 'operation->length' upper bound
is not checked and 'data_idx' also increments.

Fixes: b5b5b32081cd206b ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC")
Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com>
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-mlxbf.c