1. 12 8月, 2015 1 次提交
  2. 18 6月, 2015 1 次提交
  3. 17 6月, 2015 1 次提交
    • M
      KVM: arm/arm64: vgic: Avoid injecting reserved IRQ numbers · 4839ddc2
      Marc Zyngier 提交于
      Commit fd1d0ddf (KVM: arm/arm64: check IRQ number on userland
      injection) rightly limited the range of interrupts userspace can
      inject in a guest, but failed to consider the (unlikely) case where
      a guest is configured with 1024 interrupts.
      
      In this case, interrupts ranging from 1020 to 1023 are unuseable,
      as they have a special meaning for the GIC CPU interface.
      
      Make sure that these number cannot be used as an IRQ. Also delete
      a redundant (and similarily buggy) check in kvm_set_irq.
      Reported-by: NPeter Maydell <peter.maydell@linaro.org>
      Cc: Andre Przywara <andre.przywara@arm.com>
      Cc: <stable@vger.kernel.org> # 4.1, 4.0, 3.19, 3.18
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      4839ddc2
  4. 12 6月, 2015 1 次提交
  5. 22 4月, 2015 2 次提交
    • A
      KVM: arm/arm64: check IRQ number on userland injection · fd1d0ddf
      Andre Przywara 提交于
      When userland injects a SPI via the KVM_IRQ_LINE ioctl we currently
      only check it against a fixed limit, which historically is set
      to 127. With the new dynamic IRQ allocation the effective limit may
      actually be smaller (64).
      So when now a malicious or buggy userland injects a SPI in that
      range, we spill over on our VGIC bitmaps and bytemaps memory.
      I could trigger a host kernel NULL pointer dereference with current
      mainline by injecting some bogus IRQ number from a hacked kvmtool:
      -----------------
      ....
      DEBUG: kvm_vgic_inject_irq(kvm, cpu=0, irq=114, level=1)
      DEBUG: vgic_update_irq_pending(kvm, cpu=0, irq=114, level=1)
      DEBUG: IRQ #114 still in the game, writing to bytemap now...
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      pgd = ffffffc07652e000
      [00000000] *pgd=00000000f658b003, *pud=00000000f658b003, *pmd=0000000000000000
      Internal error: Oops: 96000006 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 1 PID: 1053 Comm: lkvm-msi-irqinj Not tainted 4.0.0-rc7+ #3027
      Hardware name: FVP Base (DT)
      task: ffffffc0774e9680 ti: ffffffc0765a8000 task.ti: ffffffc0765a8000
      PC is at kvm_vgic_inject_irq+0x234/0x310
      LR is at kvm_vgic_inject_irq+0x30c/0x310
      pc : [<ffffffc0000ae0a8>] lr : [<ffffffc0000ae180>] pstate: 80000145
      .....
      
      So this patch fixes this by checking the SPI number against the
      actual limit. Also we remove the former legacy hard limit of
      127 in the ioctl code.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Reviewed-by: NChristoffer Dall <christoffer.dall@linaro.org>
      CC: <stable@vger.kernel.org> # 4.0, 3.19, 3.18
      [maz: wrap KVM_ARM_IRQ_GIC_MAX with #ifndef __KERNEL__,
      as suggested by Christopher Covington]
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      fd1d0ddf
    • E
      KVM: arm: irqfd: fix value returned by kvm_irq_map_gsi · 0b3289eb
      Eric Auger 提交于
      irqfd/arm curently does not support routing. kvm_irq_map_gsi is
      supposed to return all the routing entries associated with the
      provided gsi and return the number of those entries. We should
      return 0 at this point.
      Signed-off-by: NEric Auger <eric.auger@linaro.org>
      Acked-by: NChristoffer Dall <christoffer.dall@linaro.org>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      0b3289eb
  6. 31 3月, 2015 1 次提交
    • A
      KVM: arm/arm64: rework MMIO abort handling to use KVM MMIO bus · 950324ab
      Andre Przywara 提交于
      Currently we have struct kvm_exit_mmio for encapsulating MMIO abort
      data to be passed on from syndrome decoding all the way down to the
      VGIC register handlers. Now as we switch the MMIO handling to be
      routed through the KVM MMIO bus, it does not make sense anymore to
      use that structure already from the beginning. So we keep the data in
      local variables until we put them into the kvm_io_bus framework.
      Then we fill kvm_exit_mmio in the VGIC only, making it a VGIC private
      structure. On that way we replace the data buffer in that structure
      with a pointer pointing to a single location in a local variable, so
      we get rid of some copying on the way.
      With all of the virtual GIC emulation code now being registered with
      the kvm_io_bus, we can remove all of the old MMIO handling code and
      its dispatching functionality.
      
      I didn't bother to rename kvm_exit_mmio (to vgic_mmio or something),
      because that touches a lot of code lines without any good reason.
      
      This is based on an original patch by Nikolay.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Cc: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
      Reviewed-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      950324ab
  7. 27 3月, 2015 3 次提交
  8. 14 3月, 2015 3 次提交
  9. 13 3月, 2015 1 次提交
  10. 12 3月, 2015 2 次提交
  11. 11 3月, 2015 1 次提交
  12. 21 1月, 2015 16 次提交
  13. 11 1月, 2015 2 次提交
  14. 15 12月, 2014 1 次提交
  15. 13 12月, 2014 3 次提交
  16. 26 11月, 2014 1 次提交