From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Guthro Subject: [PATCH] Fix double-free in tapdisk cleanup Date: Mon, 27 Aug 2007 15:02:37 -0400 Message-ID: <46D31FCD.8020300@virtualiron.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070800050609050108040305" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Josh Nicholas List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------070800050609050108040305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Fixed double-free() during normal tapdisk cleanup for quit process Signed-off-by: Ben Guthro Signed-off-by: Josh Nicholas --------------070800050609050108040305 Content-Type: text/x-patch; name="tapdisk-cleanup-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tapdisk-cleanup-fix.patch" diff -r 58aa2447f212 tools/blktap/drivers/tapdisk.c --- a/tools/blktap/drivers/tapdisk.c Wed Jul 11 15:26:55 2007 -0400 +++ b/tools/blktap/drivers/tapdisk.c Wed Jul 11 15:26:58 2007 -0400 @@ -849,6 +849,8 @@ int main(int argc, char *argv[]) exit(-1); } + DPRINTF("running R: '%s' W: '%s'\n", argv[1], argv[2]); + while (run) { ret = 0; @@ -914,12 +916,13 @@ int main(int argc, char *argv[]) s = ptr->s; unmap_disk(s); - free(s->blkif); - free(s->ring_info); - free(s); + close(ptr->tap_fd); ptr = ptr->next; } + + DPRINTF("done R: '%s' W: '%s'\n", argv[1], argv[2]); + closelog(); return 0; --------------070800050609050108040305 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------070800050609050108040305--