[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] fix compat memory exchange op splitting



A shift with a negative count was erroneously used here, yielding
undefined behavior.

Reported-by: Xi Wang <xi@xxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- 2013-02-21.orig/xen/common/compat/memory.c  2013-02-26 17:22:57.000000000 
+0100
+++ 2013-02-21/xen/common/compat/memory.c       2013-03-01 13:01:22.000000000 
+0100
@@ -173,7 +173,7 @@ int compat_memory_op(unsigned int cmd, X
                 if ( order_delta >= 0 )
                     nat.xchg->out.nr_extents = end_extent >> order_delta;
                 else
-                    nat.xchg->out.nr_extents = end_extent << order_delta;
+                    nat.xchg->out.nr_extents = end_extent << -order_delta;
                 ++split;
             }
 



Attachment: compat-mem-xchg-shift.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.