No description
  • C 98.2%
  • Assembly 1%
  • Makefile 0.3%
  • Shell 0.2%
  • Python 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Alex Williamson 07afdfd8a6 vfio/platform: Create persistent IRQ handlers
[ Upstream commit 675daf435e9f8e5a5eab140a9864dfad6668b375 ]

The vfio-platform SET_IRQS ioctl currently allows loopback triggering of
an interrupt before a signaling eventfd has been configured by the user,
which thereby allows a NULL pointer dereference.

Rather than register the IRQ relative to a valid trigger, register all
IRQs in a disabled state in the device open path.  This allows mask
operations on the IRQ to nest within the overall enable state governed
by a valid eventfd signal.  This decouples @masked, protected by the
@locked spinlock from @trigger, protected via the @igate mutex.

In doing so, it's guaranteed that changes to @trigger cannot race the
IRQ handlers because the IRQ handler is synchronously disabled before
modifying the trigger, and loopback triggering of the IRQ via ioctl is
safe due to serialization with trigger changes via igate.

For compatibility, request_irq() failures are maintained to be local to
the SET_IRQS ioctl rather than a fatal error in the open device path.
This allows, for example, a userspace driver with polling mode support
to continue to work regardless of moving the request_irq() call site.
This necessarily blocks all SET_IRQS access to the failed index.

Cc: Eric Auger <[email protected]>
Cc:  <[email protected]>
Fixes: 57f972e2b3 ("vfio/platform: trigger an interrupt via eventfd")
Reviewed-by: Kevin Tian <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2024-04-13 12:51:34 +02:00
arch x86/cpufeatures: Add new word for scattered features 2024-04-13 12:51:33 +02:00
block
certs
crypto
Documentation x86/cpu: Enable STIBP on AMD if Automatic IBRS is enabled 2024-04-13 12:51:32 +02:00
drivers vfio/platform: Create persistent IRQ handlers 2024-04-13 12:51:34 +02:00
fs exec: Fix NOMMU linux_binprm::exec in transfer_args_to_stack() 2024-04-13 12:51:31 +02:00
include vfio: Introduce interface to flush virqfd inject workqueue 2024-04-13 12:51:34 +02:00
init
ipc
kernel bounds: support non-power-of-two CONFIG_NR_CPUS 2024-04-13 12:51:31 +02:00
lib
LICENSES
mm mm/migrate: set swap entry values of THP tail pages properly. 2024-04-13 12:51:31 +02:00
net net/rds: fix possible cp null dereference 2024-04-13 12:51:33 +02:00
samples
scripts
security
sound ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs 2024-04-13 12:51:32 +02:00
tools
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.