mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86/HVM: don't crash guest in hvmemul_find_mmio_cache()
Commit35a61c05ea("x86emul: adjust handling of AVX2 gathers") builds upon the fact that the domain will actually survive running out of MMIO result buffer space. Drop the domain_crash() invocation. Also delay incrementing of the usage counter, such that the function can't possibly use/return an out-of-bounds slot/pointer in case execution subsequently makes it into the function again without a prior reset of state. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Paul Durrant <paul.durrant@citrix.com> master commit:a43c1dec24master date: 2019-03-12 14:39:46 +0100
This commit is contained in:
1 parent
d06f5613e5
commit
3f5490d7e4
1 file changed
+3
-4
@@ -945,12 +945,11 @@ static struct hvm_mmio_cache *hvmemul_find_mmio_cache(
|
||||
return cache;
|
||||
}
|
||||
|
||||
i = vio->mmio_cache_count++;
|
||||
i = vio->mmio_cache_count;
|
||||
if( i == ARRAY_SIZE(vio->mmio_cache) )
|
||||
{
|
||||
domain_crash(current->domain);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
++vio->mmio_cache_count;
|
||||
|
||||
cache = &vio->mmio_cache[i];
|
||||
memset(cache, 0, sizeof (*cache));
|
||||
|
||||