Re: vm86.c audit_syscall_exit() call trashes registers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Chuck Ebbert
Date: Tuesday, October 2, 2007 - 9:44 am

On 09/25/2007 07:38 PM, William Cattey wrote:

I think you need to zero both registers if you're using 2.6.16, and force
%eax as the source so it doesn't choose %ebp?

--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -306,19 +334,19 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
 	tsk->thread.screen_bitmap = info->screen_bitmap;
 	if (info->flags & VM86_SCREEN_BITMAP)
 		mark_screen_rdonly(tsk->mm);
-	__asm__ __volatile__("xorl %eax,%eax; movl %eax,%fs; movl %eax,%gs\n\t");
-	__asm__ __volatile__("movl %%eax, %0\n" :"=r"(eax));
 
 	/*call audit_syscall_exit since we do not exit via the normal paths */
 	if (unlikely(current->audit_context))
-		audit_syscall_exit(AUDITSC_RESULT(eax), eax);
+		audit_syscall_exit(AUDITSC_RESULT(0), 0);
 
 	__asm__ __volatile__(
 		"movl %0,%%esp\n\t"
 		"movl %1,%%ebp\n\t"
+		"mov  %2, %%fs\n\t"
+		"mov  %2, %%gs\n\t"
 		"jmp resume_userspace"
 		: /* no outputs */
-		:"r" (&info->regs), "r" (task_thread_info(tsk)));
+		:"r" (&info->regs), "r" (task_thread_info(tsk)), "a" (0));
 	/* we never return here */
 }
 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: vm86.c audit_syscall_exit() call trashes registers, William Cattey, (Tue Sep 25, 4:38 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, Jeremy Fitzhardinge, (Fri Sep 28, 5:58 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, William Cattey, (Fri Sep 28, 6:13 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, Jeremy Fitzhardinge, (Fri Sep 28, 11:06 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, Jeremy Fitzhardinge, (Fri Sep 28, 11:09 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, William Cattey, (Mon Oct 1, 3:30 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, Jeremy Fitzhardinge, (Mon Oct 1, 4:49 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, Chuck Ebbert, (Tue Oct 2, 9:44 am)
Re: vm86.c audit_syscall_exit() call trashes registers, William Cattey, (Thu Oct 4, 4:58 pm)
Re: vm86.c audit_syscall_exit() call trashes registers, Chuck Ebbert, (Thu Oct 4, 5:10 pm)