Skip to contentSkip to conversation

pvgrub: fix crash when booting kernel with p2m list outside kernel mapping

PATCH In review Juergen Gross 2 participants 2 messages Sep 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pvgrub: fix crash when booting kernel with p2m list outside kernel mapping

When trying to boot a kernel with the p2m list not mapped by the initial kernel mapping it can happen that pvgrub is failing as it is keeping some page tables mapped.

Unmap the additional page tables created for the special p2m mapping will avoid this failure.

---
This is a backport candidate for 4.7

---
 stubdom/grub/kexec.c | 2 ++
 1 file changed, 2 insertions(+)
stubdom/grub/kexec.c +2 -0
index 2ed4f6c..437a0a9 100644
@@ -347,6 +347,8 @@ void kexec(void *kernel, long kernel_size, void *module, long module_size, char
     /* Unmap libxc's projection of the boot page table */
     seg = xc_dom_seg_to_ptr(dom, &dom->pgtables_seg);
     munmap(seg, dom->pgtables_seg.vend - dom->pgtables_seg.vstart);
+    seg = xc_dom_seg_to_ptr(dom, &dom->p2m_seg);
+    munmap(seg, dom->p2m_seg.vend - dom->p2m_seg.vstart);
 
     /* Unmap day0 pages to avoid having a r/w mapping of the future page table */
     for (pfn = 0; pfn < allocated; pfn++)
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 9 lines · Juergen Gross

When trying to boot a kernel with the p2m list not mapped by the initial kernel mapping it can happen that pvgrub is failing as it is keeping some page tables mapped.

Unmap the additional page tables created for the special p2m mapping will avoid this failure.

Acked + applied.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel