[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.5] xen/arm: Don't free p2m->root in p2m_teardown() before it has been allocated
commit 8c4b40337b66679bbb776b157c747a946ed06de5 Author: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> AuthorDate: Thu Jun 2 14:19:00 2016 +0100 Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> CommitDate: Fri Jun 3 11:31:02 2016 +0100 xen/arm: Don't free p2m->root in p2m_teardown() before it has been allocated If p2m_init() didn't complete successfully, (e.g. due to VMID exhaustion), p2m_teardown() is called and unconditionally tries to free p2m->root before it has been allocated. free_domheap_pages() doesn't tolerate NULL pointers. This is XSA-181 Reported-by: Aaron Cornelius <Aaron.Cornelius@xxxxxxxxxxxxxxx> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Julien Grall <julien.grall@xxxxxxx> --- xen/arch/arm/p2m.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 62f0230..a5f33f0 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1081,7 +1081,8 @@ void p2m_teardown(struct domain *d) while ( (pg = page_list_remove_head(&p2m->pages)) ) free_domheap_page(pg); - free_domheap_pages(p2m->root, P2M_ROOT_ORDER); + if ( p2m->root ) + free_domheap_pages(p2m->root, P2M_ROOT_ORDER); p2m->root = NULL; -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.5 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |