Skip to contentSkip to conversation

Ping: [PATCH] x86: compat_show_guest_stack() should not truncate MFN

DISCUSSION Jan Beulich 3 participants 3 messages Jan 7, 2013

lore
Share & tools
lore
#0 lore raw
Quoted 25 lines
Quoted 1 line
Quoted 1 line · Jan Beulich

Re-using "addr" here was a mistake, as it is a 32-bit quantity.

xen/arch/x86/x86_64/compat/traps.c +3 -2
@@ -20,11 +20,12 @@ void compat_show_guest_stack(struct vcpu
     if ( v != current )
     {
         struct vcpu *vcpu;
+        unsigned long mfn;
 
         ASSERT(guest_kernel_mode(v, regs));
-        addr = read_cr3() >> PAGE_SHIFT;
+        mfn = read_cr3() >> PAGE_SHIFT;
         for_each_vcpu( v->domain, vcpu )
-            if ( pagetable_get_pfn(vcpu->arch.guest_table) == addr )
+            if ( pagetable_get_pfn(vcpu->arch.guest_table) == mfn )
                 break;
         if ( !vcpu )
         {
Acked-by
#1 lore raw
Quoted 4 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · Jan Beulich

Re-using "addr" here was a mistake, as it is a 32-bit quantity.

Looks right to me

Quoted 29 lines
Quoted 11 lines
xen/arch/x86/x86_64/compat/traps.c +1 -0
@@ -20,11 +20,12 @@ void compat_show_guest_stack(struct vcpu
     if ( v != current )
     {
         struct vcpu *vcpu;
+        unsigned long mfn;

xen/arch/x86/x86_64/compat/traps.c void compat_show_guest_stack(struct vcpu · line 31

Quoted 10 lines
xen/arch/x86/x86_64/compat/traps.c +2 -2
 
         ASSERT(guest_kernel_mode(v, regs));
-        addr = read_cr3() >> PAGE_SHIFT;
+        mfn = read_cr3() >> PAGE_SHIFT;
         for_each_vcpu( v->domain, vcpu )
-            if ( pagetable_get_pfn(vcpu->arch.guest_table) == addr )
+            if ( pagetable_get_pfn(vcpu->arch.guest_table) == mfn )
                 break;
         if ( !vcpu )
         {

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by
#2 lore raw
Quoted 9 lines · Ian Campbell
Quoted 4 lines · Jan Beulich
Quoted 4 lines
Quoted 1 line
Quoted 1 line · Jan Beulich

Re-using "addr" here was a mistake, as it is a 32-bit quantity.

Looks right to me

Yes, I must have missed this patch first time round.

Quoted 36 lines
Quoted 25 lines
Quoted 11 lines
xen/arch/x86/x86_64/compat/traps.c +1 -0
@@ -20,11 +20,12 @@ void compat_show_guest_stack(struct vcpu
     if ( v != current )
     {
         struct vcpu *vcpu;
+        unsigned long mfn;

xen/arch/x86/x86_64/compat/traps.c void compat_show_guest_stack(struct vcpu · line 31

Quoted 10 lines
xen/arch/x86/x86_64/compat/traps.c +2 -2
 
         ASSERT(guest_kernel_mode(v, regs));
-        addr = read_cr3() >> PAGE_SHIFT;
+        mfn = read_cr3() >> PAGE_SHIFT;
         for_each_vcpu( v->domain, vcpu )
-            if ( pagetable_get_pfn(vcpu->arch.guest_table) == addr )
+            if ( pagetable_get_pfn(vcpu->arch.guest_table) == mfn )
                 break;
         if ( !vcpu )
         {
Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel