From: Andrew Cooper Date: Mon, 3 Sep 2018 11:10:48 +0000 (+0100) Subject: xen/domain: Call lock_profile_deregister_struct() from common code X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~3329 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=10e042c43ecdc0d25c6fbcf5c4889dda5d226591;p=xen.git xen/domain: Call lock_profile_deregister_struct() from common code lock_profile_register_struct() is called from common code, but the matching deregister was previously only called from x86 code. The practical upshot of this when using CONFIG_LOCK_PROFILE, destroyed domains on ARM (and in particular, the freed page behind struct domain) remain on the lockprofile linked list, which will become corrupt when the page is reused. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich Reviewed-by: Wei Liu --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 688f7fbc4e..cd1419e740 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -298,7 +298,6 @@ struct domain *alloc_domain_struct(void) void free_domain_struct(struct domain *d) { - lock_profile_deregister_struct(LOCKPROF_TYPE_PERDOM, d); free_xenheap_page(d); } diff --git a/xen/common/domain.c b/xen/common/domain.c index b0988763a3..2fcb35b082 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -274,6 +274,8 @@ static void _domain_destroy(struct domain *d) free_cpumask_var(d->dirty_cpumask); + lock_profile_deregister_struct(LOCKPROF_TYPE_PERDOM, d); + free_domain_struct(d); }