Ubuntu-focal-kernel/drivers/gpio
Aleksandr Mishin 29b9430830 gpio: davinci: Validate the obtained number of IRQs
BugLink: https://bugs.launchpad.net/bugs/2073621

[ Upstream commit 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: eb3744a2dd ("gpio: davinci: Do not assume continuous IRQ numbering")
Signed-off-by: Aleksandr Mishin <amishin@t-argos.ru>
Link: https://lore.kernel.org/r/20240618144344.16943-1-amishin@t-argos.ru
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
2024-08-02 16:16:21 +02:00
..
Kconfig gpio: tqmx86: fix typo in Kconfig label 2024-08-02 16:16:12 +02:00
Makefile ARM: SoC driver updates for v5.4 2019-09-16 15:52:38 -07:00
TODO
gpio-74x164.c gpio: 74x164: Enable output pins after registers are reset 2024-04-26 10:54:11 +02:00
gpio-74xx-mmio.c
gpio-104-dio-48e.c
gpio-104-idi-48.c
gpio-104-idio-16.c
gpio-adnp.c
gpio-adp5520.c
gpio-adp5588.c
gpio-altera-a10sr.c
gpio-altera.c
gpio-amd-fch.c
gpio-amd8111.c gpio: amd8111: Fix PCI device reference count leak 2023-02-01 15:21:54 +01:00
gpio-amdpt.c
gpio-arizona.c gpio: arizona: put pm_runtime in case of failure 2020-08-08 01:53:12 -04:00
gpio-aspeed.c gpio: aspeed: fix the GPIO number passed to pinctrl_gpio_set_config() 2024-01-05 14:29:52 +01:00
gpio-ath79.c
gpio-bcm-kona.c gpio: bcm-kona: Fix return value of bcm_kona_gpio_probe() 2020-06-22 17:23:27 -03:00
gpio-bd9571mwv.c
gpio-bd70528.c gpio: bd70528: Use correct unit for debounce times 2019-11-12 11:18:52 +01:00
gpio-brcmstb.c
gpio-bt8xx.c
gpio-cadence.c gpio: cadence: Add missing MODULE_DEVICE_TABLE 2021-06-18 15:02:48 +02:00
gpio-clps711x.c
gpio-creg-snps.c gpio: creg-snps: use devm_platform_ioremap_resource() to simplify code 2019-09-11 14:50:02 +01:00
gpio-crystalcove.c gpio: crystalcove: Use -ENOTSUPP consistently 2024-07-05 10:51:53 +02:00
gpio-cs5535.c
gpio-da9052.c
gpio-da9055.c
gpio-davinci.c gpio: davinci: Validate the obtained number of IRQs 2024-08-02 16:16:21 +02:00
gpio-dln2.c
gpio-dwapb.c gpio: dwapb: Append MODULE_ALIAS for platform driver 2020-08-08 01:53:12 -04:00
gpio-eic-sprd.c gpio: eic-sprd: Clear interrupt after set the interrupt type 2024-03-28 15:18:33 +01:00
gpio-em.c
gpio-ep93xx.c gpio: ep93xx: Fix single irqchip with multi gpiochips 2021-03-24 11:14:25 +01:00
gpio-exar.c gpio: exar: Fix bad handling for ida_simple_get error path 2020-06-22 17:23:22 -03:00
gpio-f7188x.c
gpio-ftgpio010.c
gpio-ge.c
gpio-gpio-mm.c
gpio-grgpio.c gpio: gpio-grgpio: fix possible sleep-in-atomic-context bugs in grgpio_irq_map/unmap() 2020-02-24 16:19:27 +01:00
gpio-gw-pld.c
gpio-hlwd.c
gpio-htc-egpio.c gpio: htc-egpio: Remove unused exported htc_egpio_get_wakeup_irq() 2019-09-12 10:07:44 +01:00
gpio-ich.c
gpio-intel-mid.c gpio: intel-mid: Move hardware initialization to callback 2019-10-15 01:18:51 +02:00
gpio-iop.c
gpio-it87.c
gpio-ixp4xx.c
gpio-janz-ttl.c
gpio-kempld.c
gpio-loongson.c
gpio-loongson1.c
gpio-lp873x.c
gpio-lp3943.c
gpio-lp87565.c
gpio-lpc18xx.c
gpio-lpc32xx.c
gpio-lynxpoint.c gpio: lynxpoint: Setup correct IRQ handlers 2020-01-06 10:10:06 -06:00
gpio-madera.c
gpio-max730x.c
gpio-max732x.c
gpio-max3191x.c
gpio-max7300.c
gpio-max7301.c
gpio-max77620.c gpio: max77620: Fixup debounce delays 2019-11-12 11:13:54 +01:00
gpio-max77650.c
gpio-mb86s7x.c
gpio-mc9s08dz60.c
gpio-mc33880.c
gpio-menz127.c
gpio-merrifield.c Revert "gpio: merrifield: Pass irqchip when adding gpiochip" 2019-11-03 23:41:11 +01:00
gpio-ml-ioh.c
gpio-mlxbf.c
gpio-mm-lantiq.c
gpio-mmio.c
gpio-mockup.c gpio: mockup: Fix mode of debugfs files 2023-08-09 12:25:34 +02:00
gpio-moxtet.c
gpio-mpc8xxx.c gpio: mpc8xxx: Fix support for IRQ_TYPE_LEVEL_LOW flow_type in mpc85xx 2022-11-24 10:28:24 +01:00
gpio-mpc5200.c
gpio-msic.c
gpio-mt7621.c
gpio-mvebu.c gpio: mvebu/pwm: Refuse requests with inverted polarity 2022-08-26 11:06:48 +02:00
gpio-mxc.c gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode 2023-03-21 10:08:57 +01:00
gpio-mxs.c
gpio-octeon.c
gpio-omap.c gpio: omap: Save and restore sysconfig 2021-05-19 10:45:36 +02:00
gpio-palmas.c
gpio-pca953x.c gpio: pca953x: Add mutex_lock for regcache sync in PM 2022-11-24 10:27:55 +01:00
gpio-pcf857x.c gpio: pcf857x: Fix missing first interrupt 2021-04-14 18:31:41 +02:00
gpio-pch.c
gpio-pci-idio-16.c
gpio-pcie-idio-24.c gpio: pcie-idio-24: Enable PEX8311 interrupts 2020-12-10 12:06:38 +01:00
gpio-pisosr.c
gpio-pl061.c
gpio-pmic-eic-sprd.c gpio: pmic-eic-sprd: Add can_sleep flag for PMIC EIC chip 2024-01-05 14:29:48 +01:00
gpio-pxa.c gpio: pxa: disable pinctrl calls for MMP_GPIO 2024-01-05 14:29:52 +01:00
gpio-raspberrypi-exp.c
gpio-rc5t583.c
gpio-rcar.c gpio: rcar: Fix runtime PM imbalance on error 2020-11-09 14:47:52 +01:00
gpio-rdc321x.c
gpio-reg.c
gpio-sa1100.c
gpio-sama5d2-piobu.c
gpio-sch.c
gpio-sch311x.c
gpio-siox.c gpio: siox: explicitly support only threaded irqs 2020-11-09 14:48:05 +01:00
gpio-sodaville.c
gpio-spear-spics.c
gpio-sprd.c gpio: sprd: Clear interrupt when setting the type as edge 2020-11-09 14:48:10 +01:00
gpio-sta2x11.c
gpio-stmpe.c
gpio-stp-xway.c
gpio-syscon.c
gpio-tb10x.c gpio: tb10x: Fix an error handling path in tb10x_gpio_probe() 2024-01-05 14:29:47 +01:00
gpio-tc3589x.c gpio: tc35894: fix up tc35894 interrupt configuration 2020-11-09 14:48:06 +01:00
gpio-tegra.c gpio: tegra: mask GPIO IRQs during IRQ shutdown 2020-06-22 17:23:09 -03:00
gpio-tegra186.c gpio: tegra186: Fix chip_data type confusion 2022-05-20 15:17:19 +02:00
gpio-thunderx.c Revert "gpio: thunderx: Switch to GPIOLIB_IRQCHIP" 2020-01-30 16:25:39 +01:00
gpio-timberdale.c gpio: timberdale: Fix potential deadlock on &tgpio->lock 2024-01-05 14:29:57 +01:00
gpio-tpic2810.c
gpio-tps6586x.c
gpio-tps65086.c
gpio-tps65218.c
gpio-tps65910.c
gpio-tps65912.c
gpio-tps68470.c gpio: tps68470: Make tps68470_gpio_output() always set the initial value 2023-10-30 11:41:44 +01:00
gpio-tqmx86.c gpio: tqmx86: really make IRQ optional 2021-09-20 18:50:02 +02:00
gpio-ts4800.c
gpio-ts4900.c gpio: ts4900: Do not set DAT and OE together 2022-05-20 15:17:44 +02:00
gpio-ts5500.c
gpio-twl4030.c
gpio-twl6040.c
gpio-ucb1400.c
gpio-uniphier.c gpio: uniphier: Fix void functions to remove return value 2021-11-05 09:12:43 +01:00
gpio-vf610.c gpio: vf610: set value before the direction to avoid a glitch 2024-01-05 14:29:59 +01:00
gpio-viperboard.c
gpio-vr41xx.c MIPS: Remove repetitive increase irq_err_count 2022-08-26 11:11:12 +02:00
gpio-vx855.c
gpio-wcove.c gpio: wcove: Use -ENOTSUPP consistently 2024-07-05 10:51:53 +02:00
gpio-winbond.c gpio: winbond: Fix error code in winbond_gpio_get() 2022-08-26 11:11:14 +02:00
gpio-wm831x.c
gpio-wm8350.c
gpio-wm8994.c
gpio-ws16c48.c
gpio-xgene-sb.c
gpio-xgene.c
gpio-xilinx.c gpio: xilinx: Fix bug where the wrong GPIO register is written to 2020-02-20 08:35:31 -06:00
gpio-xlp.c
gpio-xra1403.c
gpio-xtensa.c gpio: xtensa: fix driver build 2020-01-30 16:21:58 +01:00
gpio-zevio.c
gpio-zx.c
gpio-zynq.c gpio: zynq: Check return value of pm_runtime_get_sync 2021-09-20 18:48:51 +02:00
gpiolib-acpi.c gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04 2024-03-28 15:18:32 +01:00
gpiolib-acpi.h
gpiolib-devprop.c
gpiolib-devres.c gpio: devres: Switch to EXPORT_SYMBOL_GPL() 2019-09-11 14:47:39 +01:00
gpiolib-legacy.c
gpiolib-of.c gpio: gpiolib-of: Fix refcount bugs in of_mm_gpiochip_add_data() 2022-10-17 15:01:04 +02:00
gpiolib-of.h gpio: of: Make of_get_named_gpiod_flags() private 2019-09-11 14:45:01 +01:00
gpiolib-sysfs.c gpiolib: sysfs: Fix error handling on failed export 2024-02-02 14:13:19 +01:00
gpiolib.c gpio: fix locking open drain IRQ lines 2020-06-22 17:23:33 -03:00
gpiolib.h
sgpio-aspeed.c gpio/aspeed-sgpio: don't enable all interrupts by default 2020-11-09 14:48:11 +01:00