This is a note to let you know that I've just added the patch titled xen/events: add a proper barrier to 2-level uevent unmasking to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: xen-events-add-a-proper-barrier-to-2-level-uevent-unmasking.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Tue Nov 17 12:38:50 PM CET 2020 From: Juergen Gross <jgross@xxxxxxxx> Date: Tue, 3 Nov 2020 15:29:00 +0100 Subject: xen/events: add a proper barrier to 2-level uevent unmasking To: stable@xxxxxxxxxxxxxxx Message-ID: <20201103142911.21980-4-jgross@xxxxxxxx> From: Juergen Gross <jgross@xxxxxxxx> commit 4d3fe31bd993ef504350989786858aefdb877daa upstream. A follow-up patch will require certain write to happen before an event channel is unmasked. While the memory barrier is not strictly necessary for all the callers, the main one will need it. In order to avoid an extra memory barrier when using fifo event channels, mandate evtchn_unmask() to provide write ordering. The 2-level event handling unmask operation is missing an appropriate barrier, so add it. Fifo event channels are fine in this regard due to using sync_cmpxchg(). This is part of XSA-332. Cc: stable@xxxxxxxxxxxxxxx Suggested-by: Julien Grall <julien@xxxxxxx> Signed-off-by: Juergen Gross <jgross@xxxxxxxx> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx> Reviewed-by: Wei Liu <wl@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/xen/events/events_2l.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/xen/events/events_2l.c +++ b/drivers/xen/events/events_2l.c @@ -91,6 +91,8 @@ static void evtchn_2l_unmask(unsigned po BUG_ON(!irqs_disabled()); + smp_wmb(); /* All writes before unmask must be visible. */ + if (unlikely((cpu != cpu_from_evtchn(port)))) do_hypercall = 1; else { Patches currently in stable-queue which might be from jgross@xxxxxxxx are queue-4.14/xen-blkback-use-lateeoi-irq-binding.patch queue-4.14/xen-events-block-rogue-events-for-some-time.patch queue-4.14/xen-pvcallsback-use-lateeoi-irq-binding.patch queue-4.14/xen-events-fix-race-in-evtchn_fifo_unmask.patch queue-4.14/xen-events-switch-user-event-channels-to-lateeoi-model.patch queue-4.14/xen-events-defer-eoi-in-case-of-excessive-number-of-events.patch queue-4.14/xen-events-add-a-new-late-eoi-evtchn-framework.patch queue-4.14/xen-events-use-a-common-cpu-hotplug-hook-for-event-channels.patch queue-4.14/xen-events-avoid-removing-an-event-channel-while-handling-it.patch queue-4.14/xen-netback-use-lateeoi-irq-binding.patch queue-4.14/xen-pciback-use-lateeoi-irq-binding.patch queue-4.14/xen-events-add-a-proper-barrier-to-2-level-uevent-unmasking.patch queue-4.14/xen-scsiback-use-lateeoi-irq-binding.patch