summaryrefslogtreecommitdiff
path: root/include/linux/fs
diff options
context:
space:
mode:
authorKarl Mehltretter <kmehltretter@gmail.com>2026-08-31 10:10:01 +0200
committerMarc Zyngier <maz@kernel.org>2026-10-03 13:04:40 +0100
commit8a88a46b86ca3dbbd24522760d29edfb3f24ac2a (patch)
treed9303cd365c8a5efef7f7afa7b483139868d81f9 /include/linux/fs
parentfd73f4a6659897191fa0d40695fe370925dd3780 (diff)
KVM: arm64: vgic-v3: Undo assignment on iodev registration failure
vgic_register_redist_iodev() assigns a redistributor region and base address to the vCPU before adding its iodev to the MMIO bus. However, the region's free_index is advanced only after registration succeeds. If kvm_io_bus_register_dev() fails, the vCPU retains the assignment while free_index still identifies the same slot as free. A later registration can therefore reuse a slot that remains assigned to the vCPU. Reserve the slot before registering its iodev. The caller holds slots_lock, so a registration failure cannot race with a later assignment. Undo the reservation and clear the cached assignment on failure. Fixes: dbd9733ab674 ("KVM: arm/arm64: Replace the single rdist region by a list") Cc: stable@vger.kernel.org Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com> Reviewed-by: Fuad Tabba <fuad.tabba@linux.dev> Tested-by: Fuad Tabba <fuad.tabba@linux.dev> Link: https://patch.msgid.link/20260831081005.41346-2-kmehltretter@gmail.com [maz: moved helper into the sole caller] Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'include/linux/fs')
0 files changed, 0 insertions, 0 deletions