Skip to content

Commit

Permalink
KVM: arm64: vgic-its: Fix vgic_its_check_device_id BE handling
Browse files Browse the repository at this point in the history
The ITS tables are stored in LE format. If the host is reading
a L1 table entry to check its validity, it must convert it to
the CPU endianness.

Signed-off-by: Marc Zyngier <[email protected]>
  • Loading branch information
Marc Zyngier committed Jul 18, 2016
1 parent c009107 commit 7e3963a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions virt/kvm/arm/vgic/vgic-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,8 @@ static bool vgic_its_check_device_id(struct kvm *kvm, struct vgic_its *its,
&indirect_ptr, sizeof(indirect_ptr)))
return false;

indirect_ptr = le64_to_cpu(indirect_ptr);

/* check the valid bit of the first level entry */
if (!(indirect_ptr & BIT_ULL(63)))
return false;
Expand Down

0 comments on commit 7e3963a

Please sign in to comment.