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 <andrew.coop...@citrix.com> --- CC: Jan Beulich <jbeul...@suse.com> CC: Wei Liu <wei.l...@citrix.com> CC: Roger Pau Monné <roger....@citrix.com> CC: Stefano Stabellini <sstabell...@kernel.org> CC: Julien Grall <julien.gr...@arm.com> --- xen/arch/x86/domain.c | 1 - xen/common/domain.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 688f7fb..cd1419e 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 2253c2d..9f810d1 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); } -- 2.1.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel