openssl / openssl/openssl

Single threaded CRYPTO_secure_malloc implementation is bottleneck in busy servers

Open
#23,065 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triaged: documentation triaged: performance
Dominant language
C
Stars
30.8k
Forks
11.5k
Avg merge
10m
Merged PRs (30d)
1

Description

On OpenSSL 3.1.4, 2.90% of context switches in our HTTP server are due to locking and freeing the secure_memory_lock, as this is used by all the HMAC operations in deriving the TLS keys. This measurement is for TLS 1.2.

It might be worth considering if secure_malloc, vs telling people to use encrypted swap, is worth it. Alternatively an implementation that doesn't require a single global lock should be considered, or reexamining the use in the tls1_PRF function.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing CRYPTO_secure_malloc, secure_memory_lock, and the tls1_PRF use described in the report, then measure their locking and freeing behavior under busy TLS 1.2 server workloads. Done would require a decided approach to avoid the single global-lock bottleneck and benchmark evidence showing whether it improves the reported context-switch overhead without weakening secure-memory behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.