WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] libblktapctl: fix use-after-free bug

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libblktapctl: fix use-after-free bug
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 05 Aug 2010 01:35:16 -0700
Delivery-date: Thu, 05 Aug 2010 01:35:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
# Date 1280853248 -3600
# Node ID 266df0bf4a0df8972dba8d47542401c85c5d617b
# Parent  6b9e44cf2651bbecdc03e291fde1ac0dc4bf9263
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.

Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 tools/blktap2/control/tap-ctl-list.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r 6b9e44cf2651 -r 266df0bf4a0d tools/blktap2/control/tap-ctl-list.c
--- a/tools/blktap2/control/tap-ctl-list.c      Tue Aug 03 17:14:06 2010 +0100
+++ b/tools/blktap2/control/tap-ctl-list.c      Tue Aug 03 17:34:08 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;
-
-               list_for_each_entry(tl, &tap->list, entry) {
+               struct tapdisk_list *tl, *next;
+
+               list_for_each_entry_safe(tl, next, &tap->list, entry) {
                        free(tl->params);
                        free(tl);
                }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] libblktapctl: fix use-after-free bug, Xen patchbot-unstable <=