Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: hook memory in modsecurity #279

Open
liudongmiao opened this issue Apr 1, 2022 · 3 comments
Open

feature request: hook memory in modsecurity #279

liudongmiao opened this issue Apr 1, 2022 · 3 comments

Comments

@liudongmiao
Copy link

After hook glibc, there are some clear memory leak in modsecurity transaction.

There are pcre_malloc and pcre_free in this module, so I hook all memory callback in msc_transaction, and finally resolve the memory leak in modsecurity transaction.

(I have implemented, however, I won't add a PR without discussion.)

@liudongmiao
Copy link
Author

And in our test, the performance (rps) increase about 3% - 15%.

@zxyqq
Copy link

zxyqq commented Jun 29, 2022

发个pr给我们测试下吧

@liudongmiao
Copy link
Author

@zxyqq I use it to resolve memory issues. And if you use Persistent Storage (https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#Persistent_Storage), it may won't work, as all memory would be free when transaction complete.

However, as expirevar is not implemented (https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v3.x)#expirevar), it would be ok. And I have use this patch found a transaction-related memory leak: owasp-modsecurity/ModSecurity#2727

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants