]> xenbits.xensource.com Git - xen.git/commitdiff
x86/traps: loop in the correct direction in compat_iret()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 11 Jun 2015 13:02:35 +0000 (15:02 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 11 Jun 2015 13:02:35 +0000 (15:02 +0200)
This is CVE-2015-4164 / XSA-136.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: 1f0721377952fc038b48f175d7061ec701359aac
master date: 2015-06-11 14:44:47 +0200

xen/arch/x86/x86_64/compat/traps.c

index 5f0ea0a3984c321fc648a24ad0c59a1216104049..0b784451ac9ebbd5c95f634942171c2f1e733703 100644 (file)
@@ -119,7 +119,7 @@ unsigned int compat_iret(void)
         }
         else if ( ksp > regs->_esp )
         {
-            for (i = 9; i > 0; ++i)
+            for ( i = 9; i > 0; --i )
             {
                 rc |= __get_user(x, (u32 *)regs->rsp + i);
                 rc |= __put_user(x, (u32 *)(unsigned long)ksp + i);