mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86: fix off-by-one in is_xen_fixed_mfn()
__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>
master commit: 9633929824
master date: 2019-10-25 10:38:58 +0200
This commit is contained in:
1 parent
41d85cbeaf
commit
0b1e97d77f
1 file changed
+2
-2
@@ -295,8 +295,8 @@ struct page_info
|
||||
#define is_xen_heap_mfn(mfn) \
|
||||
(__mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(_mfn(mfn))))
|
||||
#define is_xen_fixed_mfn(mfn) \
|
||||
((((mfn) << PAGE_SHIFT) >= __pa(&_stext)) && \
|
||||
(((mfn) << PAGE_SHIFT) <= __pa(&__2M_rwdata_end)))
|
||||
((((mfn) << PAGE_SHIFT) >= __pa(_stext)) && \
|
||||
(((mfn) << PAGE_SHIFT) <= __pa(__2M_rwdata_end - 1)))
|
||||
|
||||
#define PRtype_info "016lx"/* should only be used for printk's */
|
||||
|
||||
|
||||