xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libxc: Free logger after printing error message
@ 2014-05-16 20:41 Jason Andryuk
  2014-05-19 11:30 ` Ian Jackson
  2014-05-19 11:30 ` Ian Jackson
  0 siblings, 2 replies; 4+ messages in thread
From: Jason Andryuk @ 2014-05-16 20:41 UTC (permalink / raw)
  To: xen-devel; +Cc: Jason Andryuk, Ian Jackson, Ian Campbell, Stefano Stabellini

On error, PERROR calls the already destroyed logger, which can segfault.
Re-order the calls, so the logger is still available.

Signed-off-by: Jason Andryuk <andryuk@aero.org>
---
 tools/libxc/xc_private.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 0e18892..10e7e20 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -201,14 +201,14 @@ static int xc_interface_close_common(xc_interface *xch)
     if (!xch)
 	return 0;
 
+    rc = xch->ops->close(xch, xch->ops_handle);
+    if (rc) PERROR("Could not close hypervisor interface");
+
     xc__hypercall_buffer_cache_release(xch);
 
     xtl_logger_destroy(xch->dombuild_logger_tofree);
     xtl_logger_destroy(xch->error_handler_tofree);
 
-    rc = xch->ops->close(xch, xch->ops_handle);
-    if (rc) PERROR("Could not close hypervisor interface");
-
     free(xch);
     return rc;
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] libxc: Free logger after printing error message
  2014-05-16 20:41 [PATCH] libxc: Free logger after printing error message Jason Andryuk
@ 2014-05-19 11:30 ` Ian Jackson
  2014-05-19 11:30 ` Ian Jackson
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2014-05-19 11:30 UTC (permalink / raw)
  To: Jason Andryuk; +Cc: Stefano Stabellini, Ian Campbell, xen-devel

Jason Andryuk writes ("[PATCH] libxc: Free logger after printing error message"):
> On error, PERROR calls the already destroyed logger, which can segfault.
> Re-order the calls, so the logger is still available.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libxc: Free logger after printing error message
  2014-05-16 20:41 [PATCH] libxc: Free logger after printing error message Jason Andryuk
  2014-05-19 11:30 ` Ian Jackson
@ 2014-05-19 11:30 ` Ian Jackson
  2014-05-22 16:04   ` Ian Jackson
  1 sibling, 1 reply; 4+ messages in thread
From: Ian Jackson @ 2014-05-19 11:30 UTC (permalink / raw)
  To: Jason Andryuk; +Cc: Stefano Stabellini, Ian Campbell, xen-devel

Jason Andryuk writes ("[PATCH] libxc: Free logger after printing error message"):
> On error, PERROR calls the already destroyed logger, which can segfault.
> Re-order the calls, so the logger is still available.

I have also added this to my list of patches to be backported.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] libxc: Free logger after printing error message
  2014-05-19 11:30 ` Ian Jackson
@ 2014-05-22 16:04   ` Ian Jackson
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Jackson @ 2014-05-22 16:04 UTC (permalink / raw)
  To: Jason Andryuk, xen-devel, Stefano Stabellini, Ian Campbell

Ian Jackson writes ("Re: [PATCH] libxc: Free logger after printing error message"):
> Jason Andryuk writes ("[PATCH] libxc: Free logger after printing error message"):
> > On error, PERROR calls the already destroyed logger, which can segfault.
> > Re-order the calls, so the logger is still available.
> 
> I have also added this to my list of patches to be backported.

Now backported to 4.4 and will be pushed there shortly.  It's
inapplicable to 4.3.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-22 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-16 20:41 [PATCH] libxc: Free logger after printing error message Jason Andryuk
2014-05-19 11:30 ` Ian Jackson
2014-05-19 11:30 ` Ian Jackson
2014-05-22 16:04   ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).