Skip to content

KVM: Fix out-of-bounds memslot access

Sean Christopherson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: Check validity of resolved slot when searching memslotsinclude/linux/kvm_host.h+1 -11 reply
2/2KVM: s390: Return last valid slot if approx index is out-of-boundsarch/s390/kvm/kvm-s390.c+3 -06 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchCornelia HuckClaudio Imbrenda
1/2R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] KVM: Fix out-of-bounds memslot access

Two fixes for what are effectively the same bug. The binary search used for memslot lookup doesn't check the resolved index and can access memory beyond the end of the memslot array.

I split the s390 specific change to a separate patch because it's subtly different, and to simplify backporting. The KVM wide fix can be applied to stable trees as is, but AFAICT the s390 change would need to be paired with the !used_slots check from commit 774a964ef56 ("KVM: Fix out of range accesses to memslots"). This is why I tagged only the KVM wide patch for stable.

Sean Christopherson (2):
KVM: Check validity of resolved slot when searching memslots
KVM: s390: Return last valid slot if approx index is out-of-bounds

 arch/s390/kvm/kvm-s390.c | 3 +++
 include/linux/kvm_host.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
Signature · 1 line
2.24.1