]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
xenbus/xenbus_backend: Disallow pending watch messages
authorSeongJae Park <sjpark@amazon.de>
Mon, 14 Dec 2020 09:08:40 +0000 (10:08 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 4 Jan 2021 15:48:08 +0000 (16:48 +0100)
commita473eb1d07d72cfc276f5b3bbc69444ba730dba2
treeff01d22e75cd1b72a6e187987d43a67e64aac072
parentad5f0e0732ff961e741097b148dfd1c6894e8251
xenbus/xenbus_backend: Disallow pending watch messages

BugLink: https://bugs.launchpad.net/bugs/1910111
commit 9996bd494794a2fe393e97e7a982388c6249aa76 upstream.

'xenbus_backend' watches 'state' of devices, which is writable by
guests.  Hence, if guests intensively updates it, dom0 will have lots of
pending events that exhausting memory of dom0.  In other words, guests
can trigger dom0 memory pressure.  This is known as XSA-349.  However,
the watch callback of it, 'frontend_changed()', reads only 'state', so
doesn't need to have the pending events.

To avoid the problem, this commit disallows pending watch messages for
'xenbus_backend' using the 'will_handle()' watch callback.

This is part of XSA-349

Cc: stable@vger.kernel.org
Signed-off-by: SeongJae Park <sjpark@amazon.de>
Reported-by: Michael Kurth <mku@amazon.de>
Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/xen/xenbus/xenbus_probe_backend.c