Add a lock around the OBJ_NAME table
authorRich Salz <rsalz@openssl.org>
Wed, 7 Jun 2017 15:23:37 +0000 (11:23 -0400)
committerRich Salz <rsalz@openssl.org>
Wed, 7 Jun 2017 15:23:37 +0000 (11:23 -0400)
commitbe606c013d31847718ceb5d97c567988a771c2e5
tree62f2994124f8830b3f71f2ccf60d9e56a713fb33
parentdb0f35dda18403accabe98e7780f3dfc516f49de
Add a lock around the OBJ_NAME table

Various initialization functions modify this table, which can cause heap
corruption in the absence of external synchronization.

Some stats are modified from OPENSSL_LH_retrieve, where callers aren't
expecting to have to take out an exclusive lock. Switch to using atomic
operations for those stats.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3525)
crypto/lhash/lh_stats.c
crypto/lhash/lhash.c
crypto/lhash/lhash_lcl.h
crypto/objects/o_names.c