jvdmr / mod_evasive

Apache mod_evasive module
GNU General Public License v2.0
15 stars 8 forks source link

segfault with apache 2.4.41 #25

Open kosli opened 2 years ago

kosli commented 2 years ago

I had repalced the mod-evasive version delivered with Ubuntu 20.04 LTS (focal) with your version (compiled via the docker-build.sh) and apache (2.4.41-4ubuntu3.9) started segfault immediately. I am using the mpm_event module.

Have you experienced similar issues? I am not sure where to start debugging?

izfsk-ium commented 1 year ago

Similar issue occurred in apache 2.4.56

I compile mod-evasive like this: /usr/local/apache2/bin/apxs -i -a -c mod_evasive24.c

Although there was an error, it succeeded:

mod_evasive24.c: In function ‘access_checker’:
mod_evasive24.c:296:44: warning: implicit declaration of function ‘getpid’; did you mean ‘getpt’? [-Wimplicit-function-declaration]
                     fprintf(file, "%ld\n", getpid());
                                            ^~~~~~
                                            getpt

but then I found I couldn't use my CGI scripts(always got "End of script output before headers"), I checked dmesg and found segfault:

[405864.784917] User process fault: interruption code 0010 ilc:3 in mod_evasive24.so[3ff98f80000+4000]
[405864.784932] Failing address: 0000000000000000 TEID: 0000000000000800
[405864.784933] Fault in primary space mode while using user ASCE.
[405864.784934] AS:00000000823581c7 R3:0000000081574007 S:0000000000000020 
[405864.784938] CPU: 0 PID: 4673 Comm: httpd Kdump: loaded Tainted: G               X    5.14.21-150400.24.33-default #1 SLE15-SP4 fc8895a4e533ed9ce39689dc95d145d18ace31ef

My httpd was compiled by myself: Server version: Apache/2.4.56 (Unix) OS: SLES15-SP4 CPU: IBM S/390 machine type 8561 C compiler: gcc (SUSE Linux) 7.5.0

hornschorsch commented 8 months ago

Hello, the same happens here, apache segfaults after activating the module.

I then used mod_evasive20.c from https://sources.debian.org/src/libapache-mod-evasive/1.10.1-6/mod_evasive20.c/ and that works.

jvdmr commented 1 month ago

From a quick test in docker using the ubuntu:focal image (and installing apache 2.4.41), I get an error when using the mod_evasive.so compiled using the included docker-build.sh script: version 'GLIBC_2.33' not found

It makes sense to me that compiling on one system (currently debian bookworm) and running on a different system might not always work as expected, but I'm not sure this is the same issue/error you are facing.

When I compile the mod using the same ubuntu image however, everything seems to work fine. Could this possible be the issue you are facing?