Closed puppet-meteor closed 6 years ago
Thank you for reporting this!
This memory leak happens after a fatal error (error message: : Error: BMP: Error reading BMP file header #3
). There are many more like this, because sam2p doesn't have cleanup code when fatal errors are encountered, but it relies on the operating system to free the memory at process exit time (which is right after the fatal error gets reported).
Fixing this is not feasible, it would require several weeks of work with substantial refactoring of the entire sam2p codebase.
As a workaround, 3864b16a512588ac8ec05a5331be53e13a74195b adds the use of _exit on fatal errors, so memory leaks on fatal errors won't be reported by AddressSanitizer.
There is memory leaks in rule.cpp:606 at sam2p 0.49.4. A crafted input will lead to denial of service attack.
Steps to Reproduce:
./sam2p crash-253 EPS: /dev/null
POC File: https://github.com/puppet-meteor/sam2p_POC/blob/master/crash-253
Information from addresssanitizer:
found by puppet@zju.edu.cn from NESA Lab in Zhejiang University.