1
0
Fork 0
alistair23-linux/drivers/xen
Juergen Gross 85d9d02a49 xen/events: block rogue events for some time
commit 5f7f77400a upstream.

In order to avoid high dom0 load due to rogue guests sending events at
high frequency, block those events in case there was no action needed
in dom0 to handle the events.

This is done by adding a per-event counter, which set to zero in case
an EOI without the XEN_EOI_FLAG_SPURIOUS is received from a backend
driver, and incremented when this flag has been set. In case the
counter is 2 or higher delay the EOI by 1 << (cnt - 2) jiffies, but
not more than 1 second.

In order not to waste memory shorten the per-event refcnt to two bytes
(it should normally never exceed a value of 2). Add an overflow check
to evtchn_get() to make sure the 2 bytes really won't overflow.

This is part of XSA-332.

Cc: stable@vger.kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Wei Liu <wl@xen.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-05 11:43:12 +01:00
..
events xen/events: block rogue events for some time 2020-11-05 11:43:12 +01:00
xen-pciback xen/pciback: use lateeoi irq binding 2020-11-05 11:43:11 +01:00
xenbus xen/xenbus: Fix granting of vmalloc'd memory 2020-09-09 19:12:22 +02:00
xenfs
Kconfig
Makefile
acpi.c
arm-device.c
balloon.c xen/balloon: make the balloon wait interruptible 2020-08-19 08:16:29 +02:00
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c xen/events: switch user event channels to lateeoi model 2020-11-05 11:43:11 +01:00
features.c
gntalloc.c
gntdev-common.h
gntdev-dmabuf.c xen/gntdev: Fix dmabuf import with non-zero sgt offset 2020-08-19 08:16:29 +02:00
gntdev-dmabuf.h
gntdev.c xen/gntdev.c: Mark pages as dirty 2020-11-01 12:01:06 +01:00
grant-table.c
manage.c
mcelog.c
mem-reservation.c
pci.c
pcpu.c
platform-pci.c
preempt.c xen: don't reschedule in preemption off sections 2020-08-26 10:41:07 +02:00
privcmd-buf.c
privcmd.c
privcmd.h
pvcalls-back.c xen/pvcallsback: use lateeoi irq binding 2020-11-05 11:43:11 +01:00
pvcalls-front.c
pvcalls-front.h
swiotlb-xen.c swiotlb-xen: use vmalloc_to_page on vmalloc virt addresses 2020-08-26 10:40:56 +02:00
sys-hypervisor.c
time.c
xen-acpi-cpuhotplug.c
xen-acpi-memhotplug.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-front-pgdir-shbuf.c
xen-scsiback.c xen/scsiback: use lateeoi irq binding 2020-11-05 11:43:11 +01:00
xen-stub.c
xlate_mmu.c