fix xspy stack corruption
PATCH 1/1 fix xspy stack corruption
This was fun to find... we were unlucky enough for the corruption to zero out the bottom 2 bytes of the saved %ebp.
regards,
john
# HG changeset patch
# User [email protected]
# Node ID 09a9fd49601b9b5315843eb62ad7798ccb0ccd0d
# Parent 2a7a46dd3bd6a600deee21990aef41456cba9724
Fix stack corruption in the libxs python interface. domid_t is a short; instead use uint32_t like we do in xc.c.
tools/python/xen/lowlevel/xs/xs.c +3 -3
@@ -589,7 +589,7 @@ static PyObject *xspy_transaction_end(Xsstatic PyObject *xspy_introduce_domain (XsHandle *self,PyObject *args) { -domid_t dom; +uint32_t dom;unsigned long page;unsigned int port;
@@ -620,7 +620,7 @@ static PyObject *xspy_introduce_domain(Xstatic PyObject *xspy_release_domain (XsHandle *self,PyObject *args) { -domid_t dom; +uint32_t dom;struct xs_handle *xh =xshandle (self);bool result =0 ;
@@ -677,7 +677,7 @@ static PyObject *xspy_get_domain_path(Xsstatic PyObject *xspy_get_domain_path (XsHandle *self,PyObject *args) {struct xs_handle *xh =xshandle (self); -int domid; +uint32_t domid;char *xsval;if (!xh)
Quoted 2 lines · John Levon
This was fun to find... we were unlucky enough for the corruption to zero out the bottom 2 bytes of the saved %ebp.
Thanks, good catch! :-)
-- Keir
Quoted 3 lines · John Levon
This was fun to find... we were unlucky enough for the corruption to zero out the bottom 2 bytes of the saved %ebp.
Excellent work, John, thank you!
That might well have fixed the dreaded bug #411. Could people keep an eye out for the message "Xend died due to signal 9! Restarting it" in /var/log/xend.log (hopefully you'll never see it ;-)
I tried a whole host of things to try and catch this one, from valgrind to python heap debugging. How did you find it?
Ewan.
Quoted 48 lines
regards,
john# HG changeset patch
# User [email protected]
# Node ID09a9fd49601b9b5315843eb62ad7798ccb0ccd0d
# Parent2a7a46dd3bd6a600deee21990aef41456cba9724
Fix stack corruption in the libxs python interface.domid_tis a short; instead useuint32_tlike we do inxc.c.Signed-off-by John Levon <[email protected]>diff -r
2a7a46dd3bd6-r09a9fd49601btools/python/xen/lowlevel/xs/xs.ctools/python/xen/lowlevel/xs/xs.c +3
-3@@ -589,7 +589,7 @@ static PyObject *xspy_transaction_end(Xsstatic PyObject *xspy_introduce_domain (XsHandle *self,PyObject *args) { -domid_t dom; +uint32_t dom;unsigned long page;unsigned int port;@@ -620,7 +620,7 @@ static PyObject *xspy_introduce_domain(Xstatic PyObject *xspy_release_domain (XsHandle *self,PyObject *args) { -domid_t dom; +uint32_t dom;struct xs_handle *xh =xshandle (self);bool result =0 ;@@ -677,7 +677,7 @@ static PyObject *xspy_get_domain_path(Xsstatic PyObject *xspy_get_domain_path (XsHandle *self,PyObject *args) {struct xs_handle *xh =xshandle (self); -int domid; +uint32_t domid;char *xsval;if (!xh)_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel