mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
tools/xenstored: delay_request: don't assume conn->in == in
delay_request() is currently assuming that the request delayed is
always conn->in. This is currently correct, but it is a call for
a latent bug as the function allows the caller to specify any request.
To prevent any future surprise, check if the request delayed is the
current one.
Fixes: c5ca1404b4 ("tools/xenstore: add support for delaying execution of a xenstore request")
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
1 parent
3adfb50315
commit
361f1deb42
1 file changed
+3
-1
@@ -306,7 +306,9 @@ int delay_request(struct connection *conn, struct buffered_data *in,
|
||||
delayed_requests++;
|
||||
list_add(&req->list, &conn->delayed);
|
||||
|
||||
conn->in = NULL;
|
||||
/* Unlink the request from conn if this is the current one */
|
||||
if (conn->in == in)
|
||||
conn->in = NULL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||