From 3cb2915bd2762b1154ea7ce1f4dbc90171432b16 Mon Sep 17 00:00:00 2001 From: Nikola Pajkovsky Date: Mon, 29 Jun 2026 11:17:49 +0200 Subject: [PATCH 1/2] handshake: free libctx after the SSL_CTXs to fix use-after-free The SSL_CTX objects (sctx and cctx) are created from the per-pool OSSL_LIB_CTX and hold references back into it. Freeing the library context first left SSL_CTX_free() operating on a freed libctx. Reorder free_ctx_pool() so the SSL_CTXs are torn down first and the OSSL_LIB_CTX is freed last, matching their creation dependency. Fixes: https://github.com/openssl/perftools/issues/91 Assisted-by: Claude:claude-sonnet-4-8 Signed-off-by: Nikola Pajkovsky --- source/handshake.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/handshake.c b/source/handshake.c index 06c1f7f..f87c6ca 100644 --- a/source/handshake.c +++ b/source/handshake.c @@ -246,9 +246,9 @@ static void free_ctx_pool() return; for (int i = 0; i < pool_size; ++i) { if (ctx_pool[i]) { - OSSL_LIB_CTX_free(ctx_pool[i]->libctx); SSL_CTX_free(ctx_pool[i]->sctx); SSL_CTX_free(ctx_pool[i]->cctx); + OSSL_LIB_CTX_free(ctx_pool[i]->libctx); OPENSSL_free(ctx_pool[i]); } } From 58630be9d8c5835a937b0d00940f3fb515b00452 Mon Sep 17 00:00:00 2001 From: Nikola Pajkovsky Date: Mon, 29 Jun 2026 11:31:03 +0200 Subject: [PATCH 2/2] windows-latest image uses VS-2026 now Signed-off-by: Nikola Pajkovsky --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2d53bd..544bd35 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -411,13 +411,13 @@ jobs: working-directory: ".\\openssl" shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" perl Configure no-makedepend ${{ matrix.release.configopts }} - name: "Build openssl" working-directory: ".\\openssl" shell: cmd run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" nmake - name: "Checkout perftools" uses: "actions/checkout@v5"