* fix a potential issue
@ 2008-01-21 11:52 Liu, Eric E
[not found] ` <9D7649D18729DE4BB2BD7B494F7FEDC2DDC470-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Liu, Eric E @ 2008-01-21 11:52 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
>From ab2200009d437b59317a322ca0efd2b0d239b74e Mon Sep 17 00:00:00 2001
From: Feng(Eric) Liu <eric.e.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Date: Tue, 22 Jan 2008 17:01:29 -0500
Subject: [PATCH] kvm: mmu: fix a potential issue
Since the type of gpa is u64, so extend pte_size to u64. Otherwise, a
potential issue
may happen.
Signed-off-by: Feng(Eric) Liu <eric.e.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
arch/x86/kvm/mmu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index cb62ef6..c85b904 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1477,7 +1477,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu,
gpa_t gpa,
if ((gpa & (pte_size - 1)) || (bytes < pte_size)) {
gentry = 0;
r = kvm_read_guest_atomic(vcpu->kvm,
- gpa & ~(pte_size - 1),
+ gpa & ~(u64)(pte_size
- 1),
&gentry, pte_size);
new = (const void *)&gentry;
if (r < 0)
--Eric (Liu, Feng)
[-- Attachment #2: 0001-kvm-mmu-fix-a-potential-issue.patch --]
[-- Type: application/octet-stream, Size: 921 bytes --]
From daec8f015a60687e23c31e4c94c66e0e2a7d7933 Mon Sep 17 00:00:00 2001
From: Feng(Eric) Liu <eric.e.liu@intel.com>
Date: Tue, 22 Jan 2008 18:01:08 -0500
Subject: [PATCH] kvm: mmu: fix a potential issue
Since the type of gpa is u64, so extend pte_size to u64.
Otherwise, a potential issue may happen.
Signed-off-by: Feng(Eric) Liu <eric.e.liu@intel.com>
---
arch/x86/kvm/mmu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index cb62ef6..c85b904 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1477,7 +1477,7 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
if ((gpa & (pte_size - 1)) || (bytes < pte_size)) {
gentry = 0;
r = kvm_read_guest_atomic(vcpu->kvm,
- gpa & ~(pte_size - 1),
+ gpa & ~(u64)(pte_size - 1),
&gentry, pte_size);
new = (const void *)&gentry;
if (r < 0)
--
1.5.1
[-- Attachment #3: Type: text/plain, Size: 228 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-01-22 10:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-21 11:52 fix a potential issue Liu, Eric E
[not found] ` <9D7649D18729DE4BB2BD7B494F7FEDC2DDC470-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2008-01-22 10:05 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox