Restore sensible "sess_accept" counter tracking
authorBenjamin Kaduk <bkaduk@akamai.com>
Mon, 22 Oct 2018 16:54:20 +0000 (11:54 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sun, 4 Nov 2018 04:12:45 +0000 (23:12 -0500)
commit2aaa0b146b967397a6e61fa8df969e7847f82086
tree467941d36b26c9888fb2b90dc7ccbe93f0edd8e6
parent95658c32436017aeeef3d8598957071baf6769a9
Restore sensible "sess_accept" counter tracking

Commit 9ef9088c1585e13b9727796f15f77da64dbbe623 switched the SSL/SSL_CTX
statistics counters to using Thread-Sanitizer-friendly primitives.
However, it erroneously converted an addition of -1
(for s->session_ctx->stats.sess_accept) to an addition of +1, since that
is the only counter API provided by the internal tsan_assist.h header
until the previous commit.  This means that for each accepted (initial)
connection, the session_ctx's counter would get doubly incremented, and the
(switched) ctx's counter would also get incremented.

Restore the counter decrement so that each accepted connection increments
exactly one counter exactly once (in net effect).

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7464)
ssl/statem/extensions.c