]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
gpio: sim: dispose of irq mappings before destroying the irq_sim domain
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Tue, 22 Aug 2023 19:29:42 +0000 (21:29 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 30 Oct 2023 11:00:30 +0000 (12:00 +0100)
commita52d725a971e7ef614c1e18eeaaae6c974b760ef
tree5fb3e6b7c47395954f44ecdf33523e627a3ed14c
parentdfcde632075769f16aacde879a0c717fe8b07c67
gpio: sim: dispose of irq mappings before destroying the irq_sim domain

BugLink: https://bugs.launchpad.net/bugs/2039742
[ Upstream commit ab4109f91b328ff5cb5e1279f64d443241add2d1 ]

If a GPIO simulator device is unbound with interrupts still requested,
we will hit a use-after-free issue in __irq_domain_deactivate_irq(). The
owner of the irq domain must dispose of all mappings before destroying
the domain object.

Fixes: cb8c474e79be ("gpio: sim: new testing module")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpio/gpio-sim.c