> On 16 Jun 2021, at 15:43, Julien Grall <jul...@xen.org> wrote: > > From: Julien Grall <jgr...@amazon.com> > > 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 <jgr...@amazon.com> Reviewed-by: Luca Fancellu <luca.fance...@arm.com> > --- > 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 > >
- [PATCH 05/10] tools/xenstored: xenstored_core.h should inclu... Julien Grall
- Re: [PATCH 05/10] tools/xenstored: xenstored_core.h sho... Luca Fancellu
- Re: [PATCH 05/10] tools/xenstored: xenstored_core.h sho... Juergen Gross
- [PATCH 08/10] tools/xenstored: Extend restore code to handle... Julien Grall
- Re: [PATCH 08/10] tools/xenstored: Extend restore code ... Luca Fancellu
- Re: [PATCH 08/10] tools/xenstored: Extend restore code ... Juergen Gross
- Re: [PATCH 08/10] tools/xenstored: Extend restore c... Julien Grall
- Re: [PATCH 08/10] tools/xenstored: Extend resto... Juergen Gross
- [PATCH 07/10] tools/xenstored: delay_request: don't assume c... Julien Grall
- Re: [PATCH 07/10] tools/xenstored: delay_request: don't... Luca Fancellu
- Re: [PATCH 07/10] tools/xenstored: delay_request: don't... Juergen Gross
- [PATCH 09/10] tools/xenstored: Dump delayed requests Julien Grall
- Re: [PATCH 09/10] tools/xenstored: Dump delayed request... Luca Fancellu
- Re: [PATCH 09/10] tools/xenstored: Dump delayed request... Juergen Gross
- Re: [PATCH 09/10] tools/xenstored: Dump delayed req... Julien Grall
- Re: [PATCH 09/10] tools/xenstored: Dump delayed... Juergen Gross
- Re: [PATCH 09/10] tools/xenstored: Dump del... Julien Grall
- Re: [PATCH 09/10] tools/xenstored: Dum... Juergen Gross
- Re: [PATCH 09/10] tools/xenstored:... Julien Grall