Commit 43c4211e authored by Alex Williamson's avatar Alex Williamson Committed by Jinjie Ruan
Browse files

vfio: Introduce interface to flush virqfd inject workqueue

stable inclusion
from stable-v5.15.154
commit 26a6a1e0b4ecea56862f40fd2939f327395afc49
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9E6TE
CVE: CVE-2024-26812

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=26a6a1e0b4ecea56862f40fd2939f327395afc49



--------------------------------

[ Upstream commit b620ecbd17a03cacd06f014a5d3f3a11285ce053 ]

In order to synchronize changes that can affect the thread callback,
introduce an interface to force a flush of the inject workqueue.  The
irqfd pointer is only valid under spinlock, but the workqueue cannot
be flushed under spinlock.  Therefore the flush work for the irqfd is
queued under spinlock.  The vfio_irqfd_cleanup_wq workqueue is re-used
for queuing this work such that flushing the workqueue is also ordered
relative to shutdown.

Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Reviewed-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/20240308230557.805580-4-alex.williamson@redhat.com


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Conflicts:
	include/linux/vfio.h

Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
parent b152f5a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment