linux/drivers/xen/xenbus
Olaf Hering c4c303c7c5 xen/pv-on-hvm kexec: prevent crash in xenwatch_thread() when stale watch events arrive
During repeated kexec boots xenwatch_thread() can crash because
xenbus_watch->callback is cleared by xenbus_watch_path() if a node/token
combo for a new watch happens to match an already registered watch from
an old kernel.  In this case xs_watch returns -EEXISTS, then
register_xenbus_watch() does not remove the to-be-registered watch from
the list of active watches but returns the -EEXISTS to the caller
anyway.

Because the watch is still active in xenstored it will cause an event
which will arrive in the new kernel. process_msg() will find the
encapsulated struct xenbus_watch in its list of registered watches and
puts the "empty" watch handle in the queue for xenwatch_thread().
xenwatch_thread() then calls ->callback which was cleared earlier by
xenbus_watch_path().

To prevent that crash in a guest running on an old xen toolstack remove
the special -EEXIST handling.

v2:
 - remove the EEXIST handing in register_xenbus_watch() instead of
   checking for ->callback in process_msg()

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
2011-09-01 11:48:29 -04:00
..
Makefile xen: add backend driver support 2011-01-05 16:29:58 -05:00
xenbus_client.c xenbus: Xen paravirtualised PCI hotplug support. 2010-10-18 10:49:35 -04:00
xenbus_comms.c xen/xenbus: cleanup debug noise in xenbus_comms.c 2011-01-05 16:30:42 -05:00
xenbus_comms.h
xenbus_probe_backend.c xen/xenbus: fixup checkpatch issues in xenbus_probe* 2011-01-05 16:31:08 -05:00
xenbus_probe_frontend.c xen: use freeze/restore/thaw PM events for suspend/resume/chkpt 2011-03-16 13:42:56 -04:00
xenbus_probe.c xen: xenbus PM events support 2011-03-16 13:06:29 -04:00
xenbus_probe.h xen: xenbus PM events support 2011-03-16 13:06:29 -04:00
xenbus_xs.c xen/pv-on-hvm kexec: prevent crash in xenwatch_thread() when stale watch events arrive 2011-09-01 11:48:29 -04:00