Comment 3 for bug 1561589

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/18736
Committed: http://github.org/Juniper/contrail-vrouter/commit/8337190349a263e6ce4d3f1ba85b08e646c5e727
Submitter: Zuul
Branch: R3.0

commit 8337190349a263e6ce4d3f1ba85b08e646c5e727
Author: Anand H. Krishnan <email address hidden>
Date: Thu Mar 24 21:06:04 2016 +0530

Fix memory corruption at the time of unloading

Every alloc and free of memory in vRouter is accounted for by the memory
statistics subsystem of vRouter. While unloading the module, we are
freeing malloc statistics memory before packet drop statstics memory is
freed. While we do update the memory statistics only if the memory
statistics block pointer is not null, we do not seem to be zeroing the
pointer that holds the address of the memory block post release. Hence,
reverse the order of release and NULL-ify the memory statistics pointer.

Also, unregister the net device notifier before going ahead and freeing
the memory that the vhost driver keeps. If the notifier is not unregistered
first, it can potentially access freed memory that vhost driver maintains.

Change-Id: I79c4cdec4f0501e61abf38698e44e461a90c370b
Closes-BUG: #1561589