Changeset 3c475e0 in mod_gnutls for src/mod_gnutls.c


Ignore:
Timestamp:
Apr 19, 2018, 3:20:16 PM (19 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
debian/master, master
Children:
61e802c
Parents:
103cafa
Message:

Ensure that mod_gnutls child_init runs before mod_watchdog's

Our child_init hook must run before mod_watchdog's because our
watchdog threads are started there and need some child-specific
resources. A child process might (race condition) segfault if these
structures haven't been properly initialized.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mod_gnutls.c

    r103cafa r3c475e0  
    3131
    3232#define MOD_HTTP2 "mod_http2.c"
     33#define MOD_WATCHDOG "mod_watchdog.c"
    3334static const char * const mod_proxy[] = { "mod_proxy.c", NULL };
    3435static const char * const mod_http2[] = { MOD_HTTP2, NULL };
     36static const char * const mod_watchdog[] = { MOD_WATCHDOG, NULL };
    3537
    3638static void gnutls_hooks(apr_pool_t * p __attribute__((unused)))
    3739{
    3840    /* Watchdog callbacks must be configured before post_config of
    39      * mod_watchdog runs, or the watchdog won't be started. */
     41     * mod_watchdog runs, or the watchdog won't be started. Similarly,
     42     * our child_init hook must run before mod_watchdog's because our
     43     * watchdog threads are started there and need some child-specific
     44     * resources. */
    4045    static const char * const post_conf_succ[] =
    41         { MOD_HTTP2, "mod_watchdog.c", NULL };
     46        { MOD_HTTP2, MOD_WATCHDOG, NULL };
    4247    ap_hook_post_config(mgs_hook_post_config, mod_proxy, post_conf_succ,
    4348                        APR_HOOK_MIDDLE);
     
    5560                       APR_HOOK_MIDDLE);
    5661    /* Child-Init Hook */
    57     ap_hook_child_init(mgs_hook_child_init, NULL, NULL,
     62    ap_hook_child_init(mgs_hook_child_init, NULL, mod_watchdog,
    5863                       APR_HOOK_MIDDLE);
    5964    /* Authentication Hook */
Note: See TracChangeset for help on using the changeset viewer.