]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xen/events: add a proper barrier to 2-level uevent unmasking
authorJuergen Gross <jgross@suse.com>
Mon, 7 Sep 2020 13:47:27 +0000 (15:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Nov 2020 10:08:36 +0000 (11:08 +0100)
commit25f6b08895d579b461487291d6e48b3953a8bf65
tree0182a016944885acfa1040854f6e8bfed02fcb44
parent61d359d51a1cce8a5913843c8c3601dc878cc519
xen/events: add a proper barrier to 2-level uevent unmasking

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@vger.kernel.org
Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Wei Liu <wl@xen.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/events/events_2l.c