edk2/OvmfPkg/VirtioBlkDxe
Philipp Schuster 96484a32b1 OvmfPkg/VirtioBlkDxe: protect SynchronousRequest against interrupts
A UEFI timer event firing at TPL_NOTIFY can preempt SynchronousRequest
while it is executing between VirtioPrepare() and VirtioFlush(). If the
timer callback also performs a block I/O operation backed by the same
virtio-blk device, both contexts manipulate the shared virtqueue
concurrently, corrupting its state and likely crashing the firmware.

Raise the TPL to TPL_NOTIFY before VirtioPrepare() and restore it after
the completion poll to make the virtqueue manipulation and the status
check an uninterruptible sequence. This mirrors the fix applied to the
VirtioRng driver in issue #11987.

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
2026-04-23 12:48:40 +00:00
..
VirtioBlk.c OvmfPkg/VirtioBlkDxe: protect SynchronousRequest against interrupts 2026-04-23 12:48:40 +00:00
VirtioBlk.h OvmfPkg: Replace include guards with #pragma once 2026-02-23 21:01:28 +00:00
VirtioBlk.inf OvmfPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:19 -07:00