Skip to content
Commit b43fe03b authored by Aleksandr Mishin's avatar Aleksandr Mishin Committed by heyujie
Browse files

gpio: davinci: Validate the obtained number of IRQs

mainline inclusion
from mainline-v6.10-rc6
commit 7aa9b96e9a73e4ec1771492d0527bd5fc5ef9164
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IAGEP8
CVE: CVE-2024-42092

Reference: http://hulk.rnd.huawei.com/patch/detail/7aa9b96e9a73e4ec1771492d0527bd5fc5ef9164



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

Value of pdata->gpio_unbanked is taken from Device Tree. In case of broken
DT due to any error this value can be any. Without this value validation
there can be out of chips->irqs array boundaries access in
davinci_gpio_probe().

Validate the obtained nirq value so that it won't exceed the maximum
number of IRQs per bank.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: eb3744a2 ("gpio: davinci: Do not assume continuous IRQ numbering")
Signed-off-by: default avatarAleksandr Mishin <amishin@t-argos.ru>
Link: https://lore.kernel.org/r/20240618144344.16943-1-amishin@t-argos.ru


Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: default avatarHe Yujie <coka.heyujie@huawei.com>
parent a63ef247
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment