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

[Xen-changelog] [xen-unstable] KEXEC: fix kexec_get_range_compat to fail vocally.



# HG changeset patch
# User Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
# Date 1323114166 0
# Node ID 9961a6d5356a57685b06f65133c6ade5041e3356
# Parent  832fa3f3543298a7125cd5f996d1e28dd7ba47b1
KEXEC: fix kexec_get_range_compat to fail vocally.

Fail with -ERANGE rather than silently truncating 64bit values (a
physical address and size) into 32bit integers for dom0 to consume.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Simplify the bitwise arithmetic a bit.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 832fa3f35432 -r 9961a6d5356a xen/common/kexec.c
--- a/xen/common/kexec.c        Mon Dec 05 19:35:06 2011 +0000
+++ b/xen/common/kexec.c        Mon Dec 05 19:42:46 2011 +0000
@@ -395,6 +395,10 @@
 
     ret = kexec_get_range_internal(&range);
 
+    /* Dont silently truncate physical addresses or sizes. */
+    if ( (range.start | range.size) & ~(unsigned long)(~0u) )
+        return -ERANGE;
+
     if ( ret == 0 ) {
         XLAT_kexec_range(&compat_range, &range);
         if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.