]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86: fix off-by-one in is_xen_fixed_mfn()
authorJan Beulich <jbeulich@suse.com>
Fri, 25 Oct 2019 08:38:58 +0000 (10:38 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Oct 2019 08:38:58 +0000 (10:38 +0200)
__2M_rwdata_end marks the first byte after the Xen image, not its last
byte. Subtract 1 to obtain the upper bound to compare against. (Note
that instead switching from <= to < is less desirable, as in principle
__pa() might return rubbish for addresses outside of the Xen image.)

Since the & needs to be dropped from the line in question, also drop it
from the adjacent one.

Reported-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
xen/include/asm-x86/mm.h

index 3863e4ce5705718bc02e1bd17e50c0a5aeb44296..f2306e56ed65abeea9dba6c9c095fd60f9dd7d57 100644 (file)
@@ -283,8 +283,8 @@ struct page_info
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
 #define is_xen_fixed_mfn(mfn)                     \
-    (((mfn_to_maddr(mfn)) >= __pa(&_stext)) &&    \
-     ((mfn_to_maddr(mfn)) <= __pa(&__2M_rwdata_end)))
+    (((mfn_to_maddr(mfn)) >= __pa(_stext)) &&     \
+     ((mfn_to_maddr(mfn)) <= __pa(__2M_rwdata_end - 1)))
 
 #define PRtype_info "016lx"/* should only be used for printk's */