[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 07/10] tools/xenstored: delay_request: don't assume conn->in == in
- To: Julien Grall <julien@xxxxxxx>
- From: Luca Fancellu <luca.fancellu@xxxxxxx>
- Date: Mon, 21 Jun 2021 10:12:27 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wcB0ay7yLz754DCvA6zo75l+swGavIXx1xClsoBuoLQ=; b=CM9KlHvuw1ubLXLFW+11kQNDebROkYQQcjku5J7VsTp5yE2jhS3lCM1TUFXvjJHj9GkplLnh8P3PjJf0jtfXxCrnNF4XbYpL3hpoFsKmAmhC1IepXzlYdRncaF3miVZCdHN9uNMqDX2lQndSagPirzt1qsFCfcJzNMFC4cro/bpoCgICCTEUAaI4cfZGTFaKvNYsdzKmY3JD+xase6roAup6wvgvjA95MlMtkgYwfjLBEMtXWQngYWXRPmu9nOEjZX+NsZ5KIO0v1/FaGj/deXaujP1n114NGZb7c0ICpwfCTBEA9kvu99Ia3lt4nQZ0zJMXNBcc6HvXtUPx0zmUWA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cMz81y2Duil5IkpEudtPuDdDm+JjqFWDhb9NwaXM+UEvrvwYEiwa1EB8Nvxy5VB+hT53gcLYRLnMbwpG1HQlOFk6iLiAum4NDLWKP2XfKuFrN1jy3O+iix2Yh0MEcS618zQ0DXQS+8jwl/RdVdbQsQoWkE4g1K7YdQAqgEYuSgNmEUSGwgdUGtXzicvyGA9u9f9a/iVRFoJq98oBJDKw79dDDbAtKsLbjE8AihxgYJaLM3o/CH/oxwXHt+/lVf5ONwo/XGiK7TxUl4GFPnhi+t2JtgSw8dtgEYCAC2KHAY8oZkQo/wKoOGyv7rkNSChUeBTMWGFhMl8mXgpjJt+/yQ==
- Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, raphning@xxxxxxxxxxxx, doebel@xxxxxxxxx, Julien Grall <jgrall@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Mon, 21 Jun 2021 09:13:08 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
> On 16 Jun 2021, at 15:43, Julien Grall <julien@xxxxxxx> wrote:
>
> From: Julien Grall <jgrall@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
> tools/xenstore/xenstored_core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c
> index 2e5760fe4599..a5084a5b173d 100644
> --- a/tools/xenstore/xenstored_core.c
> +++ b/tools/xenstore/xenstored_core.c
> @@ -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;
> }
> --
> 2.17.1
>
>
|