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

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



# HG changeset patch
# User Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
# Date 1323168792 0
# Node ID d9f8316a829175bbc884d360568d5749c9ad840b
# Parent  3f080c79382a3468227b1d27221a4c6f75f79c73
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>
xen-unstable changeset:   24358:9961a6d5356a
xen-unstable date:        Mon Dec 05 19:42:46 2011 +0000
---


diff -r 3f080c79382a -r d9f8316a8291 xen/common/kexec.c
--- a/xen/common/kexec.c        Tue Dec 06 10:52:25 2011 +0000
+++ b/xen/common/kexec.c        Tue Dec 06 10:53:12 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®.