Skip to contentSkip to conversation

x86/32on64: zero-extend hypercall index before use in memory access (debug mode only)

PATCH In review Jan Beulich 2 participants 3 messages Dec 15, 2010 – Dec 16, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/32on64: zero-extend hypercall index before use in memory access (debug mode only)

xen/arch/x86/x86_64/compat/entry.S +2 -1
@@ -25,7 +25,8 @@ ENTRY(compat_hypercall)
         pushq UREGS_rbx(%rsp); pushq %rcx; pushq %rdx; pushq %rsi; pushq %rdi
         pushq UREGS_rbp+5*8(%rsp)
         leaq  compat_hypercall_args_table(%rip),%r10
-        movq  $6,%rcx
+        movl  %eax,%eax
+        movl  $6,%ecx
         subb  (%r10,%rax,1),%cl
         movq  %rsp,%rdi
         movl  $0xDEADBEEF,%eax
xen/arch/x86/x86_64/compat/entry.S +2 -1
@@ -25,7 +25,8 @@ ENTRY(compat_hypercall)
         pushq UREGS_rbx(%rsp); pushq %rcx; pushq %rdx; pushq %rsi; pushq %rdi
         pushq UREGS_rbp+5*8(%rsp)
         leaq  compat_hypercall_args_table(%rip),%r10
-        movq  $6,%rcx
+        movl  %eax,%eax
+        movl  $6,%ecx
         subb  (%r10,%rax,1),%cl
         movq  %rsp,%rdi
         movl  $0xDEADBEEF,%eax

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

#1 lore raw

xen/arch/x86/x86_64/compat/entry.S ENTRY(compat_hypercall) · line 29

Quoted 11 lines · Jan Beulich
xen/arch/x86/x86_64/compat/entry.S +2 -1
@@ -25,7 +25,8 @@ ENTRY(compat_hypercall)
         pushq UREGS_rbx(%rsp); pushq %rcx; pushq %rdx; pushq %rsi; pushq %rdi
         pushq UREGS_rbp+5*8(%rsp)
         leaq  compat_hypercall_args_table(%rip),%r10
-        movq  $6,%rcx
+        movl  %eax,%eax
+        movl  $6,%ecx

Is the second line part of the fix, or just a drive-by tweak?

J

#2 lore raw
Quoted 9 lines
Quoted 1 line
Quoted 1 line · Jeremy Fitzhardinge

xen/arch/x86/x86_64/compat/entry.S ENTRY(compat_hypercall) · line 25

Quoted 6 lines · Jan Beulich
xen/arch/x86/x86_64/compat/entry.S +0 -0
@@ -25,7 +25,8 @@ ENTRY(compat_hypercall)
         pushq UREGS_rbx(%rsp); pushq %rcx; pushq %rdx; pushq %rsi; pushq 

%rdi

Quoted 7 lines

xen/arch/x86/x86_64/compat/entry.S ENTRY(compat_hypercall) · line 29

Quoted 5 lines
xen/arch/x86/x86_64/compat/entry.S +2 -1
         pushq UREGS_rbp+5*8(%rsp)
         leaq  compat_hypercall_args_table(%rip),%r10
-        movq  $6,%rcx
+        movl  %eax,%eax
+        movl  $6,%ecx

Is the second line part of the fix, or just a drive-by tweak?

The latter (sorry, I couldn't withstand, as I was surprised I didn't do so when I created this code as a clone of its native counterpart).

Jan