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

[Xen-devel] [PATCH]: libblktapctl, fix use-after-free bug



This has not caused crashes because generally use after free is OK
provided nothing else is going on. However the patch makes things
correct. It also allows us to use heap poisoning feature of valgrind on
tools linking to libblktapctl.

diff -r 5c5a6081f258 tools/blktap2/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c      Tue Aug 03 15:42:53 2010 +0100
+++ b/tools/blktap2/control/tap-ctl-list.c      Tue Aug 03 16:55:04 2010 +0100
@@ -385,9 +385,9 @@ _tap_ctl_free_tapdisks(struct tapdisk *t
        struct tapdisk *tap;
 
        for (tap = tapv; tap < &tapv[n_taps]; ++tap) {
-               struct tapdisk_list *tl;
+               struct tapdisk_list *tl, *next;
 
-               list_for_each_entry(tl, &tap->list, entry) {
+               list_for_each_entry_safe(tl, next, &tap->list, entry) {
                        free(tl->params);
                        free(tl);
                }



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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