diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 11ce21fc08..e798b49b66 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -4145,6 +4145,9 @@ static int hvmop_set_param( if ( a.index >= HVM_NR_PARAMS ) return -EINVAL; + /* Make sure the above bound check is not bypassed during speculation. */ + block_speculation(); + d = rcu_lock_domain_by_any_id(a.domid); if ( d == NULL ) return -ESRCH; @@ -4411,6 +4414,9 @@ static int hvmop_get_param( if ( a.index >= HVM_NR_PARAMS ) return -EINVAL; + /* Make sure the above bound check is not bypassed during speculation. */ + block_speculation(); + d = rcu_lock_domain_by_any_id(a.domid); if ( d == NULL ) return -ESRCH;