-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Nginx 1.5.10 + ModSecurity 2.7.7: Process killed by segmentation fault at 10 #658
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
Comments
Hey guys! :) Regards |
Hi @GinoHereIam we are working on a refactoring of our nginx versions. Beta code is available at: https://github.com/SpiderLabs/ModSecurity/tree/nginx_refactoring Do you mind to test it? |
I'll give feedback in the near future. |
We are also seeing this problem. We have tested the nginx_refactoring branch and still observe the same problem... |
Hi @DOSarrest, it would be great if you can share more details about this segfault. Can you send me GDB output? while running the nginx_refactoring branch? There are instructions on how to do it here: This GDB output will be very valuable to fix the problem. Br., |
Hello @zimmerle, Yes, we are willing to do what ever we can to help resolve this. We located the information on how to do it here... https://github.com/SpiderLabs/ModSecurity/wiki/Debugging-ModSecurity and we are going to go try and get you the information right now and will reply shortly. |
Ops, Sorry I have placed the wrong link. Thanks this GDB information will be very helpful. |
Np problem, Glad to help. If you don't mind, could you also check into #713 we have not had a response on that yet. It's related to nginx refactorying. |
Here is what I am getting currently...
|
I'm trying to figure out how to get debugging symbols working |
Did you had a change to re-compile, both, ModSec and nginx with its respective "debug" enablers? If so, can you try a "make clean" (or start from a fresh directory) before: "./configure" ... "make install" |
I am using gentoo package management to handle the compilation process, and the main problem was that gentoo was stripping the binaries before installing them. I had modified the build process to stop stripping the binaries and have a better dump for you...
|
I believe that "msr->modsecurity->auditlog_lock" is - for some reason - null or invalid at the moment that "sec_audit_logger" is called (Here: https://github.com/SpiderLabs/ModSecurity/blob/nginx_refactoring/apache2/msc_logging.c#L587). It is declared here: https://github.com/SpiderLabs/ModSecurity/blob/nginx_refactoring/apache2/modsecurity.c#L122 Meanwhile, you can check the semaphores that you have running, by:
if you see too many, you can try to disabled it:
(Replace some-user-name with the user name displayed by "ipcs -s"). After that restart your nginx and let me know if this temporarily solve the problem. |
Nginx is started by root then switches to the nginx user/group. I cleared the semaphores for the root account and received two segfaults when I first ran nginx in gdb both looking like the following...
The third time I ran it, I have seen no segfaults yet, I am running a vulnerability test against the test location and it has generated over 2000 log entries so far without any errors. Typically we would see a segfault almost every session. |
Over 15000 log entries with 0 segfaults so far, so it does appear to have temporarily resolved the problem. |
Cool. Once nginx segfault it left a semaphore orphan. There is a limitation on the on the number of semaphores, when the limit is reached it is not able to create new ones leading to other problems as the original problem that you have reported. I will investigate this second segfault. Still have to patch ModSecurity to warn the user, saying that the semaphore, or, mutex was not created. Thus, ModSecurity will not start. A similar problem was reported regarding to the SecGeoLookupDb utilization, I believe that the nature of the problem is the same, i will investigate to link those two issues if applicable. |
Before removing the semaphores there was roughly 130 entries for root. On all of our production servers running only nginx they all have about the same 130 entries. Our production servers have not run nginx with modsecurity yet, and they had any segfaults. Our production servers handle a lot of traffic, could this be a issue of needing to increase the kernel.sem parameter to adequately handle our data levels when adding modsecurity into the equation? We have the current settings in our test environment for this...
|
No longer a problem in libModSecurity. Marking this as won't fix in 2.x. Please check further information on libModSecurity here: |
The process is killed by Signal 11. The software tries to allocate unassigned memory area.
kernel: [6062665.616763] nginx[8497]: segfault at 10 ip 00007fab654c2581 sp 00007fff401c4db0 error 4 in libapr-1.so.0.4.6[7fab654aa000+30000]
The text was updated successfully, but these errors were encountered: