tools/xenstored: Don't crash xenstored when Live-Update is cancelled
authorJulien GralL <jgrall@amazon.com>
Thu, 24 Jun 2021 11:15:49 +0000 (12:15 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 24 Jun 2021 11:15:49 +0000 (12:15 +0100)
commit90bafdba8ebf41c9af31b5c725a938da2a75d292
treeb0e9b7585186bdde8f0e76eee7410ac9bcc297cf
parentc8be420025ada0f90e98ae0408226e29017757df
tools/xenstored: Don't crash xenstored when Live-Update is cancelled

As Live-Update is asynchronous, it is possible to receive a request to
cancel it (either on the same connection or from a different one).

Currently, this will crash xenstored because do_lu_start() assumes
lu_status will be valid. This is not the case when Live-Update has been
cancelled. This will result to dereference a NULL pointer and
crash Xenstored.

Rework do_lu_start() to check if lu_status is NULL and return an
error in this case.

Fixes: af216a99fb ("tools/xenstore: add the basic framework for doing the live update")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
tools/xenstore/xenstored_control.c