xen/events: fix race in evtchn_fifo_unmask()
authorJuergen Gross <jgross@suse.com>
Tue, 20 Oct 2020 04:52:55 +0000 (06:52 +0200)
committerJuergen Gross <jgross@suse.com>
Tue, 20 Oct 2020 08:21:58 +0000 (10:21 +0200)
commitf01337197419b7e8a492e83089552b77d3b5fb90
treed49649615f31a412be79528e3c3deb7985a8eb87
parent4d3fe31bd993ef504350989786858aefdb877daa
xen/events: fix race in evtchn_fifo_unmask()

Unmasking a fifo event channel can result in unmasking it twice, once
directly in the kernel and once via a hypercall in case the event was
pending.

Fix that by doing the local unmask only if the event is not pending.

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>
drivers/xen/events/events_fifo.c