diff options
author | Juergen Gross <jgross@suse.com> | 2021-12-16 08:24:08 +0100 |
---|---|---|
committer | Juergen Gross <jgross@suse.com> | 2021-12-16 08:24:08 +0100 |
commit | fe415186b43df0db1f17fa3a46275fd92107fe71 (patch) | |
tree | 748fdfc2bdd32d5f9f176b6d699161d6725f1433 /drivers/xen/events | |
parent | xen/netfront: harden netfront against event channel storms (diff) | |
download | linux-fe415186b43df0db1f17fa3a46275fd92107fe71.tar.xz linux-fe415186b43df0db1f17fa3a46275fd92107fe71.zip |
xen/console: harden hvc_xen against event channel storms
The Xen console driver is still vulnerable for an attack via excessive
number of events sent by the backend. Fix that by using a lateeoi event
channel.
For the normal domU initial console this requires the introduction of
bind_evtchn_to_irq_lateeoi() as there is no xenbus device available
at the time the event channel is bound to the irq.
As the decision whether an interrupt was spurious or not requires to
test for bytes having been read from the backend, move sending the
event into the if statement, as sending an event without having found
any bytes to be read is making no sense at all.
This is part of XSA-391
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
V2:
- slightly adapt spurious irq detection (Jan Beulich)
V3:
- fix spurious irq detection (Jan Beulich)
Diffstat (limited to 'drivers/xen/events')
-rw-r--r-- | drivers/xen/events/events_base.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c index a78704ae3618..46d9295d9a6e 100644 --- a/drivers/xen/events/events_base.c +++ b/drivers/xen/events/events_base.c @@ -1251,6 +1251,12 @@ int bind_evtchn_to_irq(evtchn_port_t evtchn) } EXPORT_SYMBOL_GPL(bind_evtchn_to_irq); +int bind_evtchn_to_irq_lateeoi(evtchn_port_t evtchn) +{ + return bind_evtchn_to_irq_chip(evtchn, &xen_lateeoi_chip, NULL); +} +EXPORT_SYMBOL_GPL(bind_evtchn_to_irq_lateeoi); + static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu) { struct evtchn_bind_ipi bind_ipi; |