Commit 4b88f8bc authored by Wei Yongjun's avatar Wei Yongjun Committed by Jialin Zhang
Browse files

power: supply: adp5061: fix out-of-bounds read in adp5061_get_chg_type()

stable inclusion
from stable-v5.10.150
commit 89f305a71418591cdda18180f712f91c9820f03b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0XA

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



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

[ Upstream commit 9d47e01b ]

ADP5061_CHG_STATUS_1_CHG_STATUS is masked with 0x07, which means a length
of 8, but adp5061_chg_type array size is 4, may end up reading 4 elements
beyond the end of the adp5061_chg_type[] array.

Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarMichael Hennerich <michael.hennerich@analog.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parent 3b358d90
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment