Closed Bug 1925503 Opened 2 years ago Closed 2 years ago

Thread safety of `ssl_isInited` in `ssl_Init`

Categories

(NSS :: Libraries, defect, P3)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mdauer, Assigned: mdauer)

References

(Blocks 2 open bugs)

Details

Attachments

(1 external file)

ssl_isInited is not guared in any way, resulting in a race condition If multiple threads call ssl_Init at the same time: https://searchfox.org/mozilla-central/rev/e24f7f322960a39f9ef644a31b6026994db73850/security/nss/lib/ssl/sslinit.c#58.

Remove the short circuit test since it is no thread-safe. Although PR_CallOnceWithArg would still ensure that the function is only called once, we should just use it directly.
There should basically be no performance difference.

Assignee: nobody → mdauer
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: