x86/shadow: shadow_enable() cannot be called on oneself
PATCH 1/1 x86/shadow: shadow_enable() cannot be called on oneself
domain_pause() ASSERT()s that d != current->domain, making this particular sanity check unconditionally false.
The two callpaths leading here are from hvm_domain_initialise() (which absolutely can't be on oneself) and paging_domctl() (which checks and rejects domctls one oneself).
Signed-off-by Andrew Cooper <[email protected]>
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Tim Deegan <[email protected]>
--- xen/arch/x86/mm/shadow/common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
xen/arch/x86/mm/shadow/common.c +1 -2
@@ -2929,8 +2929,7 @@ int shadow_enable(struct domain *d, u32 mode)domain_pause (d);/* Sanity check the arguments */ -if ( (d == current->domain) || -shadow_mode_enabled (d) || +if (shadow_mode_enabled (d) || ((mode & PG_translate) && !(mode & PG_refcounts)) || ((mode & PG_external) && !(mode & PG_translate)) ) {
Signature · 1 line
1.7.10.4
Quoted 11 lines · Andrew Cooper
domain_pause()ASSERT()s that d !=current->domain, making this particular sanity check unconditionally false.The two callpaths leading here are from
hvm_domain_initialise()(which absolutely can't be on oneself) andpaging_domctl()(which checks and rejects domctls one oneself).Signed-off-by Andrew Cooper <[email protected]>CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>CC Tim Deegan <[email protected]>
Nak. This check is partly documentation and entirely harmless; I'd like to keep it.
Tim.
Quoted 21 lines
--- xen/arch/x86/mm/shadow/common.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)xen/arch/x86/mm/shadow/common.c +1
-2@@ -2929,8 +2929,7 @@ int shadow_enable(struct domain *d, u32 mode)domain_pause (d);/* Sanity check the arguments */ -if ( (d == current->domain) || -shadow_mode_enabled (d) || +if (shadow_mode_enabled (d) || ((mode & PG_translate) && !(mode & PG_refcounts)) || ((mode & PG_external) && !(mode & PG_translate)) ) {Signature · 1 line
1.7.10.4