httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1025702 - in /httpd/httpd/trunk: CHANGES server/core.c
Date Wed, 20 Oct 2010 19:53:57 GMT
Author: sf
Date: Wed Oct 20 19:53:57 2010
New Revision: 1025702

URL: http://svn.apache.org/viewvc?rev=1025702&view=rev
Log:
Be extra careful to only pass the main server config to
ap_find_loaded_module_symbol. Fixes a segfault when using per-module
LogLevel on virtual host scope.

PR: 50117

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/core.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1025702&r1=1025701&r2=1025702&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Wed Oct 20 19:53:57 2010
@@ -6,6 +6,9 @@ Changes with Apache 2.3.9
      Fix a denial of service attack against mod_reqtimeout.
      [Stefan Fritsch]
 
+  *) core: Fix segfault if per-module LogLevel is on virtual host
+     scope. PR 50117. [Stefan Fritsch]
+
   *) mod_proxy: Move the ProxyErrorOverride directive to have per
      directory scope. [Graham Leggett]
 

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=1025702&r1=1025701&r2=1025702&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Wed Oct 20 19:53:57 2010
@@ -2059,7 +2059,23 @@ static module *find_module(server_rec *s
             APR_RETRIEVE_OPTIONAL_FN(ap_find_loaded_module_symbol);
 
         if (check_symbol) {
-            found = check_symbol(s, name);
+            /*
+             * There are two phases where calling ap_find_loaded_module_symbol
+             * is problematic:
+             *
+             * During reading of the config, ap_server_conf is invalid but s
+             * points to the main server config, if passed from cmd->server
+             * of an EXEC_ON_READ directive.
+             *
+             * During config parsing, s may be a virtual host that would cause
+             * a segfault in mod_so if passed to ap_find_loaded_module_symbol,
+             * because mod_so's server config for vhosts is initialized later.
+             * But ap_server_conf is already set at this time.
+             *
+             * Therefore we use s if it is not virtual and ap_server_conf if
+             * s is virtual.
+             */
+            found = check_symbol(s->is_virtual ? ap_server_conf : s, name);
         }
     }
 



Mime
View raw message