]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen/console: harden hvc_xen against event channel storms
authorJuergen Gross <jgross@suse.com>
Thu, 16 Dec 2021 07:24:08 +0000 (08:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:19:04 +0000 (09:19 +0100)
commit57e46acb3b48ea4e8efb1e1bea2e89e0c6cc43e2
tree733d05d0ea281e98c3028e40b463890f3424a7bf
parent3559ca594f15fcd23ed10c0056d40d71e5dab8e5
xen/console: harden hvc_xen against event channel storms

This is commit fe415186b43df0db1f17fa3a46275fd92107fe71 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/hvc/hvc_xen.c