FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 08-06-2010, 09:36 AM
Shahzad Hussain Bangash
 
Default dm: Fixes memory leak in setup_indexes function

Sorry for multiple patches. This patch fixes memory leak in
setup_indexes function where memory is allocated for indexes pointer by
dm_vcalloc with the size of NODE_size and is not freed after that
through the end of the function.



--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 08-06-2010, 12:29 PM
Mike Snitzer
 
Default dm: Fixes memory leak in setup_indexes function

On Fri, Aug 06 2010 at 5:36am -0400,
Shahzad Hussain Bangash <ext-shahzad.bangash@nokia.com> wrote:

> Sorry for multiple patches. This patch fixes memory leak in
> setup_indexes function where memory is allocated for indexes pointer by
> dm_vcalloc with the size of NODE_size and is not freed after that
> through the end of the function.

There isn't a leak.

The 2nd loop's "t->index[i] = indexes;" takes ownership of the
dm_vcalloc'd memory. dm_table_destroy() will later free that memory.

Your patch actually introduces a use after free bug.

Regards,
Mike

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 01:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org