Commit 0411df39 authored by Asmaa Mnebhi's avatar Asmaa Mnebhi Committed by Jialin Zhang
Browse files

i2c: mlxbf: prevent stack overflow in mlxbf_i2c_smbus_start_transaction()

stable inclusion
from stable-v5.10.146
commit 48ee0a864d1af02eea98fc825cc230d61517a71e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0VX

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=48ee0a864d1af02eea98fc825cc230d61517a71e



--------------------------------

[ Upstream commit de24aceb ]

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

Fixes: b5b5b320 ("i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC")
Reviewed-by: default avatarKhalil Blaiech <kblaiech@nvidia.com>
Signed-off-by: default avatarAsmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 5b2ecd1e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment