summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2019-11-08 19:58:04 +0300
committerMarc Zyngier <maz@kernel.org>2019-11-10 21:48:30 +0300
commit046b5054f56691c7f5861197a812f3990f66b30e (patch)
tree95e065253d545b708840f381537681ad33bb76cb
parented0e4aa9cc74c08a429f4a389483c1076da2ca51 (diff)
downloadlinux-046b5054f56691c7f5861197a812f3990f66b30e.tar.xz
irqchip/gic-v3-its: Lock VLPI map array before translating it
Obtaining the mapping ivformation for a VLPI should always be done with the vlpi_lock for this device held. Otherwise, we expose ourselves to races against a concurrent unmap. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20191108165805.3071-11-maz@kernel.org
-rw-r--r--drivers/irqchip/irq-gic-v3-its.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 61b885133316..9c4f35ed134c 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -1492,12 +1492,14 @@ out:
static int its_vlpi_get(struct irq_data *d, struct its_cmd_info *info)
{
struct its_device *its_dev = irq_data_get_irq_chip_data(d);
- struct its_vlpi_map *map = get_vlpi_map(d);
+ struct its_vlpi_map *map;
int ret = 0;
mutex_lock(&its_dev->event_map.vlpi_lock);
- if (!its_dev->event_map.vm || !map->vm) {
+ map = get_vlpi_map(d);
+
+ if (!its_dev->event_map.vm || !map) {
ret = -EINVAL;
goto out;
}