Closed Bug 1629661 Opened 4 years ago Closed 4 years ago

MPConfig calls in SSL initializes policy before NSS is initialized.

Categories

(NSS :: Libraries, defect)

3.44
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: rrelyea, Assigned: rrelyea)

Details

Attachments

(1 file)

NSS has several config functions that multiprocess servers must call before NSS is initialized to set up shared memory caches between the processes. These functions call ssl_init(), which initializes the ssl policy. The ssl policy initialization, however needs to happen after NSS itself is initialized. Doing so before hand causes (in the best case) policy to be ignored by these servers, and crashes (in the worst case).

Instead, these cache functions should just initialize those things it needs (that is the cache locks). The cache lock init calls are idempotent, so it's safe to call the init multiple times (here and in ssl_init()).

Related downstream bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1804015

Assignee: nobody → rrelyea
Status: NEW → ASSIGNED

NSS has several config functions that multiprocess servers must call before NSS is initialized to set up shared memory caches between the processes. These functions call ssl_init(), which initializes the ssl policy. The ssl policy initialization, however needs to happen after NSS itself is initialized. Doing so before hand causes (in the best case) policy to be ignored by these servers, and crashes (in the worst case).

Instead, these cache functions should just initialize those things it needs (that is the NSPR ssl error codes).

This patch does:

  1. fixes the cache init code to only initialize error codes.
  2. fixes the selfserv MP code to 1) be compatible with ssl.sh's selfserv management (at least on Unix), and 2) mimic the way real servers handle the MP_Cache init code (calling NSS_Init after the cache set up).
  3. update ssl.sh server policy test to test policy usage on an MP server. This
    is only done for non-windows like OS's because they can't catch the kill signal
    to force their children to shutdown.

I've verified that the test fails if 2 and 3 are included but 1 is not
(and succeeds if all three are included).

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.52
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: