httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r551835 - in /httpd/httpd/trunk: ./ include/ server/ server/mpm/beos/ server/mpm/experimental/event/ server/mpm/experimental/leader/ server/mpm/experimental/perchild/ server/mpm/experimental/threadpool/ server/mpm/mpmt_os2/ server/mpm/netwa...
Date Fri, 29 Jun 2007 09:31:26 GMT
Author: jorton
Date: Fri Jun 29 02:31:11 2007
New Revision: 551835

URL: http://svn.apache.org/viewvc?view=rev&rev=551835
Log:
Revert r547987 ("svn merge -c -547987 .")

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/include/mpm_common.h
    httpd/httpd/trunk/server/main.c
    httpd/httpd/trunk/server/mpm/beos/mpm.h
    httpd/httpd/trunk/server/mpm/experimental/event/event.c
    httpd/httpd/trunk/server/mpm/experimental/event/mpm.h
    httpd/httpd/trunk/server/mpm/experimental/leader/mpm.h
    httpd/httpd/trunk/server/mpm/experimental/perchild/mpm.h
    httpd/httpd/trunk/server/mpm/experimental/threadpool/mpm.h
    httpd/httpd/trunk/server/mpm/mpmt_os2/mpm.h
    httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c
    httpd/httpd/trunk/server/mpm/netware/mpm.h
    httpd/httpd/trunk/server/mpm/prefork/mpm.h
    httpd/httpd/trunk/server/mpm/prefork/prefork.c
    httpd/httpd/trunk/server/mpm/worker/mpm.h
    httpd/httpd/trunk/server/mpm/worker/worker.c
    httpd/httpd/trunk/server/mpm_common.c
    httpd/httpd/trunk/server/scoreboard.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Jun 29 02:31:11 2007
@@ -7,12 +7,6 @@
      server-status page and ExtendedStatus enabled, for browsers which
      perform charset "detection".  Reported by Stefan Esser.  [Joe Orton]
 
-  *) SECURITY: CVE-2007-3304 (cve.mitre.org)
-     Add a parent process local table of child process PIDs, and
-     use that to ensure we are sending signals to just our child
-     processes by checking the scoreboard PID entries to our local
-     copy. [Jim Jagielski]
-
   *) Event MPM: Add support for running under mod_ssl, by reverting to the
      Worker MPM behaviors, when run under an input filter that buffers
      its own data. [Paul Querna]

Modified: httpd/httpd/trunk/include/mpm_common.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/mpm_common.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/include/mpm_common.h (original)
+++ httpd/httpd/trunk/include/mpm_common.h Fri Jun 29 02:31:11 2007
@@ -349,14 +349,6 @@
                                              const char *arg);
 #endif
 
-/*
- * The parent process pid table
- */
-extern apr_table_t *ap_pid_table;
-int ap_in_pid_table(pid_t pid);
-void ap_set_pid_table(pid_t pid);
-void ap_unset_pid_table(pid_t pid);
-
 AP_DECLARE_HOOK(int,monitor,(apr_pool_t *p))
 
 #ifdef __cplusplus

Modified: httpd/httpd/trunk/server/main.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/main.c?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/main.c (original)
+++ httpd/httpd/trunk/server/main.c Fri Jun 29 02:31:11 2007
@@ -480,9 +480,6 @@
     ap_server_pre_read_config  = apr_array_make(pcommands, 1, sizeof(char *));
     ap_server_post_read_config = apr_array_make(pcommands, 1, sizeof(char *));
     ap_server_config_defines   = apr_array_make(pcommands, 1, sizeof(char *));
-#ifdef AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
-    ap_pid_table               = apr_table_make(pglobal, 1024);
-#endif
 
     error = ap_setup_prelinked_modules(process);
     if (error) {

Modified: httpd/httpd/trunk/server/mpm/beos/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/beos/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/beos/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/beos/mpm.h Fri Jun 29 02:31:11 2007
@@ -31,10 +31,7 @@
 
 #define MPM_NAME "Beos"
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->servers[0][i].tid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 
 #define AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
 #define AP_MPM_WANT_WAIT_OR_TIMEOUT

Modified: httpd/httpd/trunk/server/mpm/experimental/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/event/event.c?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/experimental/event/event.c Fri Jun 29 02:31:11 2007
@@ -1652,7 +1652,6 @@
     /* else */
     ap_scoreboard_image->parent[slot].quiescing = 0;
     ap_scoreboard_image->parent[slot].pid = pid;
-    ap_set_pid_table(pid);
     return 0;
 }
 
@@ -2072,12 +2071,10 @@
             active_children = 0;
             for (index = 0; index < ap_daemons_limit; ++index) {
                 if (MPM_CHILD_PID(index) != 0) {
-                    if (ap_in_pid_table(MPM_CHILD_PID(index))) {
-                        if (kill(MPM_CHILD_PID(index), 0) == 0) {
+                    if (kill(MPM_CHILD_PID(index), 0) == 0) {
                             active_children = 1;
                             /* Having just one child is enough to stay around */
                             break;
-                        }
                     }
                 }
             }

Modified: httpd/httpd/trunk/server/mpm/experimental/event/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/event/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/event/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/experimental/event/mpm.h Fri Jun 29 02:31:11 2007
@@ -50,10 +50,7 @@
 #define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 #define MPM_ACCEPT_FUNC unixd_accept
 
 extern int ap_threads_per_child;

Modified: httpd/httpd/trunk/server/mpm/experimental/leader/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/leader/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/leader/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/experimental/leader/mpm.h Fri Jun 29 02:31:11 2007
@@ -50,10 +50,7 @@
 
 #define AP_MPM_USES_POD 1
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 #define MPM_ACCEPT_FUNC unixd_accept
 
 extern int ap_threads_per_child;

Modified: httpd/httpd/trunk/server/mpm/experimental/perchild/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/perchild/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/perchild/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/experimental/perchild/mpm.h Fri Jun 29 02:31:11 2007
@@ -49,10 +49,7 @@
 #define AP_MPM_USES_POD
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 #define MPM_ACCEPT_FUNC unixd_accept
 
 /* Table of child status */

Modified: httpd/httpd/trunk/server/mpm/experimental/threadpool/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/threadpool/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/threadpool/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/experimental/threadpool/mpm.h Fri Jun 29 02:31:11 2007
@@ -49,10 +49,7 @@
 #define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 #define MPM_ACCEPT_FUNC unixd_accept
 
 extern int ap_threads_per_child;

Modified: httpd/httpd/trunk/server/mpm/mpmt_os2/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/mpm.h Fri Jun 29 02:31:11 2007
@@ -30,7 +30,6 @@
 #include "httpd.h"
 #include "mpm_default.h"
 #include "scoreboard.h"
-#include "mpm_common.h"
 
 #define MPM_NAME "MPMT_OS2"
 

Modified: httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c (original)
+++ httpd/httpd/trunk/server/mpm/mpmt_os2/mpmt_os2.c Fri Jun 29 02:31:11 2007
@@ -281,7 +281,6 @@
 #endif
     if (one_process) {
         ap_scoreboard_image->parent[0].pid = getpid();
-        ap_set_pid_table(getpid());
         ap_mpm_child_main(pconf);
         return FALSE;
     }
@@ -308,7 +307,6 @@
         rc = DosWaitChild(DCWA_PROCESSTREE, DCWW_NOWAIT, &proc_rc, &child_pid, 0);
 
         if (rc == 0) {
-            ap_unset_pid_table(child_pid);
             /* A child has terminated, remove its scoreboard entry & terminate if necessary
*/
             for (slot=0; ap_scoreboard_image->parent[slot].pid != child_pid &&
slot < HARD_SERVER_LIMIT; slot++);
 
@@ -332,13 +330,7 @@
 
     /* Signal children to shut down, either gracefully or immediately */
     for (slot=0; slot<HARD_SERVER_LIMIT; slot++) {
-        PID pid;
-
-        pid = ap_scoreboard_image->parent[n].pid;
-        if (ap_in_pid_table(pid)) {
-            kill(pid, is_graceful ? SIGHUP : SIGTERM);
-            ap_unset_pid_table(pid);
-        }
+      kill(ap_scoreboard_image->parent[slot].pid, is_graceful ? SIGHUP : SIGTERM);
     }
 
     DosFreeMem(parent_info);
@@ -372,7 +364,6 @@
     }
 
     ap_scoreboard_image->parent[slot].pid = proc_rc.codeTerminate;
-    ap_set_pid_table(proc_rc.codeTerminate);
 }
 
 

Modified: httpd/httpd/trunk/server/mpm/netware/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/netware/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/netware/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/netware/mpm.h Fri Jun 29 02:31:11 2007
@@ -48,10 +48,7 @@
 */
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 
 extern int ap_threads_per_child;
 extern int ap_max_workers_limit;

Modified: httpd/httpd/trunk/server/mpm/prefork/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/prefork/mpm.h Fri Jun 29 02:31:11 2007
@@ -52,10 +52,7 @@
 
 #define AP_MPM_USES_POD 1
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 #define MPM_ACCEPT_FUNC unixd_accept
 
 extern int ap_threads_per_child;

Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Fri Jun 29 02:31:11 2007
@@ -714,7 +714,6 @@
     }
 
     ap_scoreboard_image->parent[slot].pid = pid;
-    ap_set_pid_table(pid);
 
     return 0;
 }
@@ -1097,10 +1096,8 @@
         for (index = 0; index < ap_daemons_limit; ++index) {
             if (ap_scoreboard_image->servers[index][0].status != SERVER_DEAD) {
                 /* Ask each child to close its listeners. */
-                if (ap_in_pid_table(MPM_CHILD_PID(index))) {
-                    kill(MPM_CHILD_PID(index), AP_SIG_GRACEFUL);
-                    active_children++;
-                }
+                kill(MPM_CHILD_PID(index), AP_SIG_GRACEFUL);
+                active_children++;
             }
         }
 
@@ -1138,12 +1135,10 @@
             active_children = 0;
             for (index = 0; index < ap_daemons_limit; ++index) {
                 if (MPM_CHILD_PID(index) != 0) {
-                    if (ap_in_pid_table(MPM_CHILD_PID(index))) {
-                        if (kill(MPM_CHILD_PID(index), 0) == 0) {
+                    if (kill(MPM_CHILD_PID(index), 0) == 0) {
                             active_children = 1;
                             /* Having just one child is enough to stay around */
                             break;
-                        }
                     }
                 }
             }
@@ -1196,9 +1191,7 @@
                  * piped loggers, etc. They almost certainly won't handle
                  * it gracefully.
                  */
-                if (ap_in_pid_table(MPM_CHILD_PID(index))) {
-                    kill(MPM_CHILD_PID(index), AP_SIG_GRACEFUL);
-                }
+                kill(ap_scoreboard_image->parent[index].pid, AP_SIG_GRACEFUL);
             }
         }
     }

Modified: httpd/httpd/trunk/server/mpm/worker/mpm.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/mpm.h?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/mpm.h (original)
+++ httpd/httpd/trunk/server/mpm/worker/mpm.h Fri Jun 29 02:31:11 2007
@@ -50,10 +50,7 @@
 #define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
 
 #define MPM_CHILD_PID(i) (ap_scoreboard_image->parent[i].pid)
-#define MPM_NOTE_CHILD_KILLED(i) do {         \
-        ap_unset_pid_table(MPM_CHILD_PID(i)); \
-        MPM_CHILD_PID(i) = 0;                 \
-    } while(0) 
+#define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 #define MPM_ACCEPT_FUNC unixd_accept
 
 extern int ap_threads_per_child;

Modified: httpd/httpd/trunk/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/worker.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/worker.c Fri Jun 29 02:31:11 2007
@@ -1360,8 +1360,6 @@
     }
     ap_scoreboard_image->parent[slot].quiescing = 0;
     ap_scoreboard_image->parent[slot].pid = pid;
-    ap_set_pid_table(pid);
-
     return 0;
 }
 
@@ -1602,7 +1600,6 @@
                                                         (request_rec *) NULL);
 
                 ap_scoreboard_image->parent[child_slot].pid = 0;
-                ap_unset_pid_table(pid.pid);
                 ap_scoreboard_image->parent[child_slot].quiescing = 0;
                 if (processed_status == APEXIT_CHILDSICK) {
                     /* resource shortage, minimize the fork rate */
@@ -1819,12 +1816,10 @@
             active_children = 0;
             for (index = 0; index < ap_daemons_limit; ++index) {
                 if (MPM_CHILD_PID(index) != 0) {
-                    if (ap_in_pid_table(MPM_CHILD_PID(index))) {
-                        if (kill(MPM_CHILD_PID(index), 0) == 0) {
+                    if (kill(MPM_CHILD_PID(index), 0) == 0) {
                             active_children = 1;
                             /* Having just one child is enough to stay around */
                             break;
-                        }
                     }
                 }
             }

Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_common.c?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Fri Jun 29 02:31:11 2007
@@ -87,41 +87,6 @@
 
 static extra_process_t *extras;
 
-/*
- * Parent process local storage of child pids
- */
-apr_table_t *ap_pid_table;
-
-/*
- * Check the pid table to see if the actual pid exists
- */
-int ap_in_pid_table(pid_t pid) {
-    char apid[64];
-    const char *spid;
-    apr_snprintf(apid, sizeof(apid), "%" APR_PID_T_FMT, pid);
-    spid = apr_table_get(ap_pid_table, apid);
-    if (spid && spid[0] == '1' && spid[1] == '\0')
-        return 1;
-    else {
-        ap_log_error(APLOG_MARK, APLOG_ERR, 0, ap_server_conf,
-                     "child process %" APR_PID_T_FMT
-                     " does not exist in local pid table", pid);
-        return 0;
-    }
-}
-
-void ap_set_pid_table(pid_t pid) {
-    char apid[64];
-    apr_snprintf(apid, sizeof(apid), "%" APR_PID_T_FMT, pid);
-    apr_table_set(ap_pid_table, apid, "1");
-}
-
-void ap_unset_pid_table(pid_t pid) {
-    char apid[64];
-    apr_snprintf(apid, sizeof(apid), "%" APR_PID_T_FMT, pid);
-    apr_table_unset(ap_pid_table, apid);
-}
-
 void ap_register_extra_mpm_process(pid_t pid)
 {
     extra_process_t *p = (extra_process_t *)malloc(sizeof(extra_process_t));
@@ -149,7 +114,6 @@
             extras = cur->next;
         }
         free(cur);
-        ap_unset_pid_table(pid);
         return 1; /* found */
     }
     else {
@@ -164,9 +128,6 @@
     apr_status_t waitret;
 
     proc.pid = pid;
-    if (!ap_in_pid_table(pid)) {
-        return 0;
-    }
     waitret = apr_proc_wait(&proc, NULL, NULL, APR_NOWAIT);
     if (waitret != APR_CHILD_NOTDONE) {
         return 1;

Modified: httpd/httpd/trunk/server/scoreboard.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/scoreboard.c?view=diff&rev=551835&r1=551834&r2=551835
==============================================================================
--- httpd/httpd/trunk/server/scoreboard.c (original)
+++ httpd/httpd/trunk/server/scoreboard.c Fri Jun 29 02:31:11 2007
@@ -35,7 +35,6 @@
 #include "ap_mpm.h"
 
 #include "mpm.h"
-#include "mpm_common.h"
 #include "scoreboard.h"
 
 AP_DECLARE_DATA scoreboard *ap_scoreboard_image = NULL;
@@ -364,8 +363,7 @@
     ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons_limit);
 
     for (i = 0; i < max_daemons_limit; ++i) {
-        if (ap_scoreboard_image->parent[i].pid == pid->pid &&
-            ap_in_pid_table(pid->pid)) {
+        if (ap_scoreboard_image->parent[i].pid == pid->pid) {
             return i;
         }
     }



Mime
View raw message