Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame^] | 1 | From: Jan Beulich <jbeulich@suse.com> |
| 2 | Subject: x86/paging: don't unconditionally BUG() on finding SHARED_M2P_ENTRY |
| 3 | |
| 4 | PV guests can fully control the values written into the P2M. |
| 5 | |
| 6 | This is XSA-251. |
| 7 | |
| 8 | Signed-off-by: Jan Beulich <jbeulich@suse.com> |
| 9 | Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> |
| 10 | |
| 11 | --- a/xen/arch/x86/mm/paging.c |
| 12 | +++ b/xen/arch/x86/mm/paging.c |
| 13 | @@ -274,7 +274,7 @@ void paging_mark_pfn_dirty(struct domain |
| 14 | return; |
| 15 | |
| 16 | /* Shared MFNs should NEVER be marked dirty */ |
| 17 | - BUG_ON(SHARED_M2P(pfn_x(pfn))); |
| 18 | + BUG_ON(paging_mode_translate(d) && SHARED_M2P(pfn_x(pfn))); |
| 19 | |
| 20 | /* |
| 21 | * Values with the MSB set denote MFNs that aren't really part of the |