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

[Xen-changelog] [xen stable-4.1] fix compat memory exchange op splitting



commit 6b2f399604ba0d46203855658b72b9fcba76a7ac
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Mar 12 16:23:55 2013 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Mar 12 16:23:55 2013 +0100

    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>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    master changeset: 53decd322157e922cac2988e07da6d39538c8033
    master date: 2013-03-01 16:59:49 +0100
---
 xen/common/compat/memory.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/compat/memory.c b/xen/common/compat/memory.c
index 1d877fc..5f494eb 100644
--- a/xen/common/compat/memory.c
+++ b/xen/common/compat/memory.c
@@ -171,7 +171,7 @@ int compat_memory_op(unsigned int cmd, 
XEN_GUEST_HANDLE(void) compat)
                 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;
             }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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