[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tools/xenstored: Stash the correct request in lu_status->in


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Mon, 5 Jul 2021 09:24:04 +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=tEl4brartcAHQUPbgw9ZN9Araas3hK5D+e7rf16BL8U=; b=DqQrucEqNsK8Gk7LjELBg5rkoyFaYLxXZNcuMbu95HjyzZULmGWbFfnjyNyyZYDOetFXlzZG6bnI697g99oz4wA+nGYsgFTn71wt1rdief61tnnO3tMYAAasOhxSURAGDxpShGuVtHdHpj03Ol/oMFWviZY9xTn2kxLuH465ZVLfv8/nUZs2W5FzV+/06ZAlk91wMGGgecFe6viP0fjsQuSV9nEVF+6p80/IXyBgZSFCQ2/wTiXHSZh7D2f7DquxxuUEvahsEAIEAnk5U+4DOC0Mcw2dvgXKyuzycjqNjmt1HV3H7wVKbOyFxp1L3/R6ibi5pw92Y5mNViw4VRl4+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FTM334XLOVzTICEGsc2PyISJGN+4eM/70cByTZVuNWl25N6rIrh8z6U/qCdOn/ZoZw6xpTdhpf44OFYRy8nzT293wqlkSIZpXvbbJsoqEob3SyBwjzIOVD+6lQe0bjei2WEww5EkseswITxP9PpPcGg0FcWdn8QuRhNu14HpNZgdqnotijdZs6JycwFFDaPO9ZhI40JaQB24aeKjQVwxbDmiSvKBuV8cGB+8nTK2Lod4i7onNYHmCRp+sU7iqASe0ZK8WJw8AB8743xzV/C2BZP9KA/kuBKUQ5LfkxaEkeIE7ox2oEKLYZ0GiOZHB/q5erDAZu3Atr29fUZSLm4ivg==
  • 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, 05 Jul 2021 08:24:24 +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 1 Jul 2021, at 15:03, Julien Grall <julien@xxxxxxx> wrote:
> 
> From: Julien Grall <jgrall@xxxxxxxxxx>
> 
> When Live-Updating with some load, Xenstored may hit the assert
> req->in == lu_status->in in do_lu_start().
> 
> This is happening because the request is stashed when Live-Update
> begins. This happens in a different request (see call lu_begin()
> when select the new binary) from the one performing Live-Update.
> 
> To avoid the problem, stash the request in lu_start().
> 
> Fixes: 65f19ed62aa1 ("tools/xenstore: Don't assume conn->in points to the LU 
> request")
> Reported-by: Michael Kurth <mku@xxxxxxxxxx>
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>

Reviewed-by: luca.fancellu@xxxxxxx

> 
> ----
> 
> This was sadly missed because the on my testing the 2 requests were
> residing at the same place in memory.
> 
> This was reproduced by creating domain while Live-Updating. Without
> the patch, Xenstored will crash.
> ---
> tools/xenstore/xenstored_control.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/xenstore/xenstored_control.c 
> b/tools/xenstore/xenstored_control.c
> index a1b1bd5a718d..ff9863c17fa4 100644
> --- a/tools/xenstore/xenstored_control.c
> +++ b/tools/xenstore/xenstored_control.c
> @@ -103,7 +103,6 @@ static const char *lu_begin(struct connection *conn)
>       if (!lu_status)
>               return "Allocation failure.";
>       lu_status->conn = conn;
> -     lu_status->in = conn->in;
>       talloc_set_destructor(lu_status, lu_destroy);
> 
>       return NULL;
> @@ -757,6 +756,7 @@ static const char *lu_start(const void *ctx, struct 
> connection *conn,
>       lu_status->force = force;
>       lu_status->timeout = to;
>       lu_status->started_at = time(NULL);
> +     lu_status->in = conn->in;
> 
>       errno = delay_request(conn, conn->in, do_lu_start, conn, false);
> 
> -- 
> 2.17.1
> 
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.