Commit 0b0bdd36 authored by Antonio Borneo's avatar Antonio Borneo Committed by Zheng Zengkai
Browse files

pinctrl: stm32: fix array read out of bound

stable inclusion
from stable-v6.6.5
commit a9659016f9ebc0868b74d1982e38d3af4511f948
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8N21P

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



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

[ Upstream commit edd48fd9d45370d6c8ba0dd834fcc51ff688cc87 ]

The existing code does not verify if the "tentative" index exceeds
the size of the array, causing out of bound read.
Issue identified with kasan.

Check the index before using it.

Signed-off-by: default avatarAntonio Borneo <antonio.borneo@foss.st.com>
Fixes: 32c170ff ("pinctrl: stm32: set default gpio line names using pin names")
Link: https://lore.kernel.org/r/20231107110520.4449-1-antonio.borneo@foss.st.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 6d2742cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment