[patch libnl] fix double free caused by freeing link af_data in rtnl_link_set_family()

Thomas Graf tgraf at suug.ch
Wed Aug 21 08:46:58 EDT 2013


On 08/21/13 at 02:40pm, Jiri Pirko wrote:
> Introduced by commit 8026fe2e3a9089eff3f5a06ee6e3cc78d96334ed ("link:
> Free and realloc af specific data upon rtnl_link_set_family()")
> 
> link->l_af_data[link->l_af_ops->ao_family] is freed here but not set to
> zero. That leads to double free made by link_free_data->do_foreach_af.
> 
> Fix this by setting link->l_af_data[link->l_af_ops->ao_family] to zero
> rigth after free.
> 
> Signed-off-by: Jiri Pirko <jiri at resnulli.us>

Applied, thanks Jiri.



More information about the libnl mailing list