]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commit
Fix buffer overrun when suspending VMs with many vCPUs
authorOwen Smith <owen.smith@cloud.com>
Thu, 25 May 2023 15:14:09 +0000 (16:14 +0100)
committerPaul Durrant <pdurrant@amazon.com>
Fri, 9 Jun 2023 13:06:48 +0000 (14:06 +0100)
commit5e15f3b6c1bfbac761963d00610a0aa9d657f0e7
treeb3b6bef91535e33448d59b8270f8eb96c36923d7
parent41f13e3872f331f1b891d32aa2a3cb2cbea20b71
Fix buffer overrun when suspending VMs with many vCPUs

Dynamically allocate the KDPC array. __Section is defined as a PAGE_SIZE
region, which can only contain a limited number of KDPC objects in addition
to the SYNC_CONTEXT header. Dynamic allocation of the KDPC objects will
remove this restriction.

Signed-off-by: Owen Smith <owen.smith@cloud.com>
Always dynamically allocate KDPC objects, allowing us to get rid of
__Section and define SyncContext as a simple static global. Hence amend
the original commit comment.

Also use __AllocatePoolWithTag() and __FreePoolWithTag() rather than
open-coding them.

Signed-off-by: Paul Durrant <paul@xen.org>
src/xenbus/sync.c