aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2012-11-21 18:29:12 -0500
committerAlexander Graf <agraf@suse.de>2012-12-05 19:33:59 -0500
commit05dd85f7933ffbe6d71415e631c95ca615ae1e81 (patch)
tree692796f7f43064301bd7d06167b2024ed9b11595
parenta64fd707481631b9682f9baeefac489bc55bbf73 (diff)
KVM: PPC: Book3S HV: Report correct HPT entry index when reading HPT
This fixes a bug in the code which allows userspace to read out the contents of the guest's hashed page table (HPT). On the second and subsequent passes through the HPT, when we are reporting only those entries that have changed, we were incorrectly initializing the index field of the header with the index of the first entry we skipped rather than the first changed entry. This fixes it. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index 1029e2201bf6..ac6b5acb99b9 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -1282,7 +1282,6 @@ static ssize_t kvm_htab_read(struct file *file, char __user *buf,
1282 while (nb + sizeof(hdr) + HPTE_SIZE < count) { 1282 while (nb + sizeof(hdr) + HPTE_SIZE < count) {
1283 /* Initialize header */ 1283 /* Initialize header */
1284 hptr = (struct kvm_get_htab_header __user *)buf; 1284 hptr = (struct kvm_get_htab_header __user *)buf;
1285 hdr.index = i;
1286 hdr.n_valid = 0; 1285 hdr.n_valid = 0;
1287 hdr.n_invalid = 0; 1286 hdr.n_invalid = 0;
1288 nw = nb; 1287 nw = nb;
@@ -1298,6 +1297,7 @@ static ssize_t kvm_htab_read(struct file *file, char __user *buf,
1298 ++revp; 1297 ++revp;
1299 } 1298 }
1300 } 1299 }
1300 hdr.index = i;
1301 1301
1302 /* Grab a series of valid entries */ 1302 /* Grab a series of valid entries */
1303 while (i < kvm->arch.hpt_npte && 1303 while (i < kvm->arch.hpt_npte &&