Jan Beulich
2010-Dec-15 10:50 UTC
[Xen-devel] [PATCH] x86/32on64: zero-extend hypercall index before use in memory access (debug mode only)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -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
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
Jeremy Fitzhardinge
2010-Dec-15 22:21 UTC
Re: [Xen-devel] [PATCH] x86/32on64: zero-extend hypercall index before use in memory access (debug mode only)
On 12/15/2010 02:50 AM, Jan Beulich wrote:> Signed-off-by: Jan Beulich <jbeulich@novell.com> > > --- a/xen/arch/x86/x86_64/compat/entry.S > +++ b/xen/arch/x86/x86_64/compat/entry.S > @@ -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,%ecxIs the second line part of the fix, or just a drive-by tweak? J _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jan Beulich
2010-Dec-16 08:04 UTC
Re: [Xen-devel] [PATCH] x86/32on64: zero-extend hypercall index before use in memory access (debug mode only)
>>> On 15.12.10 at 23:21, Jeremy Fitzhardinge <jeremy@goop.org> wrote: > On 12/15/2010 02:50 AM, Jan Beulich wrote: >> Signed-off-by: Jan Beulich <jbeulich@novell.com> >> >> --- a/xen/arch/x86/x86_64/compat/entry.S >> +++ b/xen/arch/x86/x86_64/compat/entry.S >> @@ -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?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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel