Skip to contentSkip to conversation

another 32-on-64 bugfix

PATCH New Jan Beulich 1 participant 1 message Jan 25, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 another 32-on-64 bugfix

Fix a one-off error in compat_addr_ok().

xen/include/asm-x86/x86_64/uaccess.h +2 -1
Index: 2007-01-08/xen/include/asm-x86/x86_64/uaccess.h
===================================================================
@@ -20,7 +20,8 @@
 #define __compat_addr_ok(addr) \
     ((unsigned long)(addr) < HYPERVISOR_COMPAT_VIRT_START(current->domain))
 
-#define compat_access_ok(addr, size) __compat_addr_ok((addr) + (size))
+#define compat_access_ok(addr, size) \
+    __compat_addr_ok((unsigned long)(addr) + ((size) ? (size) - 1 : 0))
 
 #define compat_array_access_ok(addr,count,size) \
     (likely((count) < (~0U / (size))) && \