commit 2cef39d7d18db1d2c6bc7d9e0c49b996387198a4
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.
Reviewed: https:/ /review. opencontrail. org/18763 github. org/Juniper/ contrail- vrouter/ commit/ 2cef39d7d18db1d 2c6bc7d9e0c49b9 96387198a4
Committed: http://
Submitter: Zuul
Branch: master
commit 2cef39d7d18db1d 2c6bc7d9e0c49b9 96387198a4
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: I79c4cdec4f0501 e61abf38698e44e 461a90c370b
Closes-BUG: #1561589