summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2024-10-02 21:49:59 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-22 15:46:35 +0200
commit01282ab5182f85e42234df2ff42f0ce790f465ff (patch)
tree13f7ae5d8a2272586d24c3b56f037c3bbc801c8a /include
parentfad940e2dd789155f99ecafa71a7baf6f96530bc (diff)
downloadlinux-01282ab5182f85e42234df2ff42f0ce790f465ff.tar.gz
linux-01282ab5182f85e42234df2ff42f0ce790f465ff.tar.bz2
linux-01282ab5182f85e42234df2ff42f0ce790f465ff.zip
irqchip/gic-v4: Don't allow a VMOVP on a dying VPE
commit 1442ee0011983f0c5c4b92380e6853afb513841a upstream. Kunkun Jiang reported that there is a small window of opportunity for userspace to force a change of affinity for a VPE while the VPE has already been unmapped, but the corresponding doorbell interrupt still visible in /proc/irq/. Plug the race by checking the value of vmapp_count, which tracks whether the VPE is mapped ot not, and returning an error in this case. This involves making vmapp_count common to both GICv4.1 and its v4.0 ancestor. Fixes: 64edfaa9a234 ("irqchip/gic-v4.1: Implement the v4.1 flavour of VMAPP") Reported-by: Kunkun Jiang <jiangkunkun@huawei.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/c182ece6-2ba0-ce4f-3404-dba7a3ab6c52@huawei.com Link: https://lore.kernel.org/all/20241002204959.2051709-1-maz@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/irqchip/arm-gic-v4.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/irqchip/arm-gic-v4.h b/include/linux/irqchip/arm-gic-v4.h
index 2c63375bbd43..bf9e0640288d 100644
--- a/include/linux/irqchip/arm-gic-v4.h
+++ b/include/linux/irqchip/arm-gic-v4.h
@@ -58,10 +58,12 @@ struct its_vpe {
bool enabled;
bool group;
} sgi_config[16];
- atomic_t vmapp_count;
};
};
+ /* Track the VPE being mapped */
+ atomic_t vmapp_count;
+
/*
* Ensures mutual exclusion between affinity setting of the
* vPE and vLPI operations using vpe->col_idx.