]> git.baikalelectronics.ru Git - kernel.git/commit
pinctrl: nuvoton: wpcm450: fix out of bounds write
authorMikhail Kobuk <m.kobuk@ispras.ru>
Fri, 25 Aug 2023 10:15:28 +0000 (13:15 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Oct 2023 21:08:52 +0000 (23:08 +0200)
commit6c18c386fd13dbb3ff31a1086dabb526780d9bda
tree6031fff36be141e2715497739162717404f68175
parent37157830a97f4b7d45637a2f9ee0363706e2b0af
pinctrl: nuvoton: wpcm450: fix out of bounds write

[ Upstream commit 87d315a34133edcb29c4cadbf196ec6c30dfd47b ]

Write into 'pctrl->gpio_bank' happens before the check for GPIO index
validity, so out of bounds write may happen.

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

Fixes: a1d1e0e3d80a ("pinctrl: nuvoton: Add driver for WPCM450")
Signed-off-by: Mikhail Kobuk <m.kobuk@ispras.ru>
Reviewed-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Link: https://lore.kernel.org/r/20230825101532.6624-1-m.kobuk@ispras.ru
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pinctrl/nuvoton/pinctrl-wpcm450.c