mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/HVM: correct MMIO emulation cache bounds check
To avoid overrunning the internal buffer we need to take the offset into the buffer into account. Fixes:d95da91fb4("x86/HVM: grow MMIO cache data size to 64 bytes") Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com> master commit:e5339bb689master date: 2025-01-23 11:14:48 +0100
This commit is contained in:
1 parent
da7790b8f2
commit
0d2799a557
1 file changed
+1
-1
@@ -937,7 +937,7 @@ static int hvmemul_phys_mmio_access(
|
||||
}
|
||||
|
||||
/* Accesses must not overflow the cache's buffer. */
|
||||
if ( size > sizeof(cache->buffer) )
|
||||
if ( offset + size > sizeof(cache->buffer) )
|
||||
{
|
||||
ASSERT_UNREACHABLE();
|
||||
return X86EMUL_UNHANDLEABLE;
|
||||
|
||||