Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
858085f
commit 2cef39d
Showing
3 changed files
with
7 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters