René's URL Explorer Experiment


Title: gh-149816: Fix SNI callback callable race by kiri11 · Pull Request #150018 · python/cpython · GitHub

Open Graph Title: gh-149816: Fix SNI callback callable race by kiri11 · Pull Request #150018 · python/cpython

X Title: gh-149816: Fix SNI callback callable race by kiri11 · Pull Request #150018 · python/cpython

Description: Problem Fix a use-after-free race in the SSL SNI callback on free-threaded builds. When sni_callback is replaced or cleared on one thread while another thread is mid-handshake, the old callback object could be freed before the handshake thread finishes calling it. Reader side (_servername_callback): acquire sslctx's critical section, snapshot the callback with Py_XNewRef into a local, then release. The local strong reference keeps the callable alive for the duration of the call. Setter side (sni_callback_set): already holds the same critical section via @critical_section clinic annotation. Uses Py_XSETREF to swap the pointer and decref the old callback atomically. The OpenSSL callback registration is set after the pointer is stored, so a concurrent handshake always finds a valid callable. Setter clearing (sni_callback = None): unregisters the OpenSSL callback first, then clears the Python reference. Serialized against the reader by the same critical section. Testing Adds a free-threading stress test that spawns handshake workers and a callback-toggling thread concurrently. Plus manually tested on MacOS. Before % ./python.exe -m test test_ssl -m test_sni_callback_race Raised RLIMIT_NOFILE: 256 -> 1024 Using random seed: 2655205590 0:00:00 load avg: 4.31 Run 1 test sequentially in a single process 0:00:00 load avg: 4.31 [1/1] test_ssl ================== WARNING: ThreadSanitizer: data race (pid=68672) Write of size 8 at 0x000126f10588 by thread T29: #0 _ssl__SSLContext_sni_callback_set_impl _ssl.c:5304 (_ssl.cpython-316t-darwin.so:arm64+0xe5f0) #1 _ssl__SSLContext_sni_callback_set _ssl.c.h:2266 (_ssl.cpython-316t-darwin.so:arm64+0xe5f0) #2 _PyObject_GenericSetAttrWithDict object.c:2049 (python.exe:arm64+0x1000dd900) #3 pythread_wrapper thread_pthread.h:234 (python.exe:arm64+0x10026e378) Previous read of size 8 at 0x000126f10588 by thread T13: #0 _servername_callback _ssl.c:5159 (_ssl.cpython-316t-darwin.so:arm64+0xffa0) #1 final_server_name (libssl.3.dylib:arm64+0x5c31c) #2 _PyEval_EvalFrameDefault generated_cases.c.h:4142 (python.exe:arm64+0x1001c5b50) #3 pythread_wrapper thread_pthread.h:234 (python.exe:arm64+0x10026e378) Thread T29 (tid=707684, running) created by main thread at: #0 pthread_create (libclang_rt.tsan_osx_dynamic.dylib:arm64+0x31d84) #1 do_start_joinable_thread thread_pthread.h:281 (python.exe:arm64+0x10026d9f8) #2 do_start_new_thread _threadmodule.c:1919 (python.exe:arm64+0x10032782c) #3 thread_PyThread_start_joinable_thread _threadmodule.c:2042 (python.exe:arm64+0x100326894) #4 cfunction_call methodobject.c:564 (python.exe:arm64+0x1000d27b4) Thread T13 (tid=707668, running) created by main thread at: #0 pthread_create (libclang_rt.tsan_osx_dynamic.dylib:arm64+0x31d84) #1 do_start_joinable_thread thread_pthread.h:281 (python.exe:arm64+0x10026d9f8) #2 do_start_new_thread _threadmodule.c:1919 (python.exe:arm64+0x10032782c) #3 thread_PyThread_start_joinable_thread _threadmodule.c:2042 (python.exe:arm64+0x100326894) #4 cfunction_call methodobject.c:564 (python.exe:arm64+0x1000d27b4) SUMMARY: ThreadSanitizer: data race _ssl.c:5304 in _ssl__SSLContext_sni_callback_set_impl ================== Warning -- Unraisable exception Exception ignored in ssl servername callback while calling set SNI callback : Traceback (most recent call last): File "/Users/kignatev/PycharmProjects/cpython/Lib/ssl.py", line 963, in do_handshake self._sslobj.do_handshake() ~~~~~~~~~~~~~~~~~~~~~~~~~^^ SystemError: null argument to internal routine Fatal Python error: Segmentation fault Stack (most recent call first): Current thread's C stack trace (most recent call first): Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _Py_DumpStack+0x44 [0x104db912c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at faulthandler_fatal_error+0x330 [0x104dddf98] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _ZN6__tsanL21CallUserSignalHandlerEPNS_11ThreadStateEbbiPN11__sanitizer23__sanitizer_siginfo_padEPv+0x104 [0x10570f910] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _Z10sighandleriPN11__sanitizer23__sanitizer_siginfo_padEPv+0x1a8 [0x10570fb68] Binary file "/usr/lib/system/libsystem_platform.dylib", at _sigtramp+0x38 [0x182e257a4] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_EvalFrameDefault+0xc71c [0x104d152e4] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_Vector+0x2d8 [0x104d076ec] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at object_vacall+0x138 [0x104babb78] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at PyObject_CallFunctionObjArgs+0x38 [0x104babce0] Binary file "/Users/kignatev/PycharmProjects/cpython/Modules/_ssl.cpython-316t-darwin.so", at _servername_callback+0x274 [0x10f9c01c8] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at final_server_name+0x6c [0x113db4320] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at tls_parse_all_extensions+0xa8 [0x113db3a10] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at tls_post_process_client_hello+0x560 [0x113dcf678] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at state_machine+0x59c [0x113dbe824] Binary file "/Users/kignatev/PycharmProjects/cpython/Modules/_ssl.cpython-316t-darwin.so", at _ssl__SSLSocket_do_handshake+0x184 [0x10f9c093c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_EvalFrameDefault+0x4f8c [0x104d0db54] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_Vector+0x2d8 [0x104d076ec] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyObject_VectorcallPrepend+0x144 [0x104bab0c8] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at context_run+0x88 [0x104d3b77c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at PyObject_Vectorcall+0x58 [0x104ba9a40] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _Py_VectorCallInstrumentation_StackRefSteal+0x12c [0x104d07d10] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_EvalFrameDefault+0x21b4 [0x104d0ad7c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_Vector+0x2d8 [0x104d076ec] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyObject_VectorcallPrepend+0x144 [0x104bab0c8] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at thread_run+0xe0 [0x104e6ff58] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at pythread_wrapper+0x1c [0x104db637c] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at __tsan_thread_start_func+0x8c [0x105709cf8] Binary file "/usr/lib/system/libsystem_pthread.dylib", at _pthread_start+0x88 [0x182e1bc58] Binary file "/usr/lib/system/libsystem_pthread.dylib", at thread_start+0x8 [0x182e16c1c] ThreadSanitizer:DEADLYSIGNAL ==68672==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000104d0ef10 bp 0x00017e422240 sp 0x00017e421fe0 T707674) ==68672==The signal is caused by a READ memory access. ==68672==Hint: address points to the zero page. Warning -- Unraisable exception Exception ignored in ssl servername callback while calling set SNI callback : Traceback (most recent call last): File "/Users/kignatev/PycharmProjects/cpython/Lib/ssl.py", line 963, in do_handshake self._sslobj.do_handshake() ~~~~~~~~~~~~~~~~~~~~~~~~~^^ SystemError: null argument to internal routine #0 _PyEval_EvalFrameDefault generated_cases.c.h:5550 (python.exe:arm64+0x1001c6f10) #1 _PyEval_EvalFrame pycore_ceval.h:122 (python.exe:arm64+0x1001bf6e8) #2 _PyEval_Vector ceval.c:2156 (python.exe:arm64+0x1001bf6e8) #3 _PyObject_VectorcallTstate pycore_call.h:144 (python.exe:arm64+0x100063b74) #4 object_vacall call.c:823 (python.exe:arm64+0x100063b74) #5 PyObject_CallFunctionObjArgs call.c:977 (python.exe:arm64+0x100063cdc) #6 _servername_callback _ssl.c:5214 (_ssl.cpython-316t-darwin.so:arm64+0x101c4) #7 final_server_name (libssl.3.dylib:arm64+0x5c31c) #8 tls_parse_all_extensions (libssl.3.dylib:arm64+0x5ba0c) #9 tls_post_process_client_hello (libssl.3.dylib:arm64+0x77674) #10 state_machine (libssl.3.dylib:arm64+0x66820) #11 _ssl__SSLSocket_do_handshake_impl _ssl.c:1098 (_ssl.cpython-316t-darwin.so:arm64+0x10938) #12 _ssl__SSLSocket_do_handshake _ssl.c.h:30 (_ssl.cpython-316t-darwin.so:arm64+0x10938) #13 _PyEval_EvalFrameDefault generated_cases.c.h:4142 (python.exe:arm64+0x1001c5b50) #14 _PyEval_EvalFrame pycore_ceval.h:122 (python.exe:arm64+0x1001bf6e8) #15 _PyEval_Vector ceval.c:2156 (python.exe:arm64+0x1001bf6e8) #16 _PyObject_VectorcallTstate pycore_call.h:144 (python.exe:arm64+0x1000630c4) #17 _PyObject_VectorcallPrepend call.c:855 (python.exe:arm64+0x1000630c4) #18 _PyObject_VectorcallTstate pycore_call.h:144 (python.exe:arm64+0x1001f3778) #19 context_run context.c:727 (python.exe:arm64+0x1001f3778) #20 _PyObject_VectorcallTstate pycore_call.h:144 (python.exe:arm64+0x100061a3c) #21 PyObject_Vectorcall call.c:327 (python.exe:arm64+0x100061a3c) #22 _Py_VectorCallInstrumentation_StackRefSteal ceval.c:775 (python.exe:arm64+0x1001bfd0c) #23 _PyEval_EvalFrameDefault generated_cases.c.h:1846 (python.exe:arm64+0x1001c2d78) #24 _PyEval_EvalFrame pycore_ceval.h:122 (python.exe:arm64+0x1001bf6e8) #25 _PyEval_Vector ceval.c:2156 (python.exe:arm64+0x1001bf6e8) #26 _PyObject_VectorcallTstate pycore_call.h:144 (python.exe:arm64+0x1000630c4) #27 _PyObject_VectorcallPrepend call.c:855 (python.exe:arm64+0x1000630c4) #28 thread_run _threadmodule.c:388 (python.exe:arm64+0x100327f54) #29 pythread_wrapper thread_pthread.h:234 (python.exe:arm64+0x10026e378) #30 __tsan_thread_start_func (libclang_rt.tsan_osx_dynamic.dylib:arm64+0x31cf4) #31 _pthread_start (libsystem_pthread.dylib:arm64e+0x6c54) #32 thread_start (libsystem_pthread.dylib:arm64e+0x1c18) ==68672==Register values: x[0] = 0x000000010e21dc88 x[1] = 0x00000001171c02e8 x[2] = 0x0000000000000000 x[3] = 0x000000017e422250 x[4] = 0x0000000000000003 x[5] = 0x0000000000000000 x[6] = 0x0000000000000000 x[7] = 0x0000000000366b00 x[8] = 0x0000000000000030 x[9] = 0x00000001171c0338 x[10] = 0x0000000000000001 x[11] = 0x0000000000000003 x[12] = 0x000000010505bda1 x[13] = 0x0000000000000003 x[14] = 0x0000000000000075 x[15] = 0x00000001eec259a0 x[16] = 0x0000000000000018 x[17] = 0x000000010e21dc70 x[18] = 0x0000000000000000 x[19] = 0x00000001171c0328 x[20] = 0x00000001171c0358 x[21] = 0x0000000104fd7da8 x[22] = 0x000000030e1001c0 x[23] = 0x000000030e1001c0 x[24] = 0x0000000000000000 x[25] = 0x0000000000000001 x[26] = 0x000000000000001d x[27] = 0x00000001171c02e8 x[28] = 0x00000001240b8000 fp = 0x000000017e422240 lr = 0x0000000104d152e4 sp = 0x000000017e421fe0 ThreadSanitizer can not provide additional info. SUMMARY: ThreadSanitizer: SEGV generated_cases.c.h:5550 in _PyEval_EvalFrameDefault ==68672==ABORTING Fatal Python error: Aborted Stack (most recent call first): Current thread's C stack trace (most recent call first): Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _Py_DumpStack+0x44 [0x104db912c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at faulthandler_fatal_error+0x330 [0x104dddf98] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _ZN6__tsanL21CallUserSignalHandlerEPNS_11ThreadStateEbbiPN11__sanitizer23__sanitizer_siginfo_padEPv+0x104 [0x10570f910] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _Z10sighandleriPN11__sanitizer23__sanitizer_siginfo_padEPv+0x1a8 [0x10570fb68] Binary file "/usr/lib/system/libsystem_platform.dylib", at _sigtramp+0x38 [0x182e257a4] Binary file "/usr/lib/system/libsystem_pthread.dylib", at pthread_kill+0x128 [0x182e1b8d8] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at wrap_pthread_kill+0x134 [0x105710278] Binary file "/usr/lib/system/libsystem_c.dylib", at abort+0x94 [0x182d22790] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _ZN11__sanitizer6AtexitEPFvvE+0x0 [0x1056f11b4] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _ZN11__sanitizer3DieEv+0x68 [0x1056f06e4] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _ZN11__sanitizer13SignalContextC1EPvS1_+0x0 [0x1056fd974] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _ZN6__tsanL21CallUserSignalHandlerEPNS_11ThreadStateEbbiPN11__sanitizer23__sanitizer_siginfo_padEPv+0x104 [0x10570f910] Binary file "/opt/homebrew/Cellar/llvm/22.1.5/lib/clang/22/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib", at _Z10sighandleriPN11__sanitizer23__sanitizer_siginfo_padEPv+0x1a8 [0x10570fb68] Binary file "/usr/lib/system/libsystem_platform.dylib", at _sigtramp+0x38 [0x182e257a4] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_EvalFrameDefault+0xc71c [0x104d152e4] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_Vector+0x2d8 [0x104d076ec] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at object_vacall+0x138 [0x104babb78] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at PyObject_CallFunctionObjArgs+0x38 [0x104babce0] Binary file "/Users/kignatev/PycharmProjects/cpython/Modules/_ssl.cpython-316t-darwin.so", at _servername_callback+0x274 [0x10f9c01c8] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at final_server_name+0x6c [0x113db4320] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at tls_parse_all_extensions+0xa8 [0x113db3a10] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at tls_post_process_client_hello+0x560 [0x113dcf678] Binary file "/opt/homebrew/Cellar/openssl@3/3.6.2/lib/libssl.3.dylib", at state_machine+0x59c [0x113dbe824] Binary file "/Users/kignatev/PycharmProjects/cpython/Modules/_ssl.cpython-316t-darwin.so", at _ssl__SSLSocket_do_handshake+0x184 [0x10f9c093c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_EvalFrameDefault+0x4f8c [0x104d0db54] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_Vector+0x2d8 [0x104d076ec] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyObject_VectorcallPrepend+0x144 [0x104bab0c8] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at context_run+0x88 [0x104d3b77c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at PyObject_Vectorcall+0x58 [0x104ba9a40] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _Py_VectorCallInstrumentation_StackRefSteal+0x12c [0x104d07d10] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_EvalFrameDefault+0x21b4 [0x104d0ad7c] Binary file "/Users/kignatev/PycharmProjects/cpython/python.exe", at _PyEval_Vector+0x2d8 [0x104d076ec] zsh: abort ./python.exe -m test test_ssl -m test_sni_callback_race After 0:00:00 load avg: 4.18 [1/1] test_ssl passed Using Repro: % ./python.exe cpython-ft/repros/49.py finding: 49 SSLContext.sni_callback replacement race expected signal: native crash/fatal error/sanitizer use-after-free during concurrent SNI handshakes parameters: seconds=10; Python=3.16.0a0; GIL_enabled=False; workers=28 ------------------------------------------------------------------------ Completed without interpreter crash: 53271 handshakes, 0 Python-level failures, 245825 toggles. More info Issue: gh-149816

Open Graph Description: Problem Fix a use-after-free race in the SSL SNI callback on free-threaded builds. When sni_callback is replaced or cleared on one thread while another thread is mid-handshake, the old callback obj...

X Description: Problem Fix a use-after-free race in the SSL SNI callback on free-threaded builds. When sni_callback is replaced or cleared on one thread while another thread is mid-handshake, the old callback obj...

Opengraph URL: https://github.com/python/cpython/pull/150018

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c4ba7efd-9276-eda8-d6c1-de4ce683a22f
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id823E:1FBEDF:D4287D:11D23CB:6A5169D6
html-safe-nonce7d5f69b110046bc40d5129494cd4d56e15076dbf968c89af831b8e91c017d47f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjNFOjFGQkVERjpENDI4N0Q6MTFEMjNDQjo2QTUxNjlENiIsInZpc2l0b3JfaWQiOiI0MjI1NjUyOTg0MTMwNzA4MDYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacef1e10c8efdbd0dbe27301a230042a440fbad56afffd85cabdd20e669dd545eb
hovercard-subject-tagpull_request:3704179141
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/150018/files
twitter:imagehttps://avatars.githubusercontent.com/u/658408?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/658408?s=400&v=4
og:image:altProblem Fix a use-after-free race in the SSL SNI callback on free-threaded builds. When sni_callback is replaced or cleared on one thread while another thread is mid-handshake, the old callback obj...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release60eaaf6d4dbaa817031b556aebd8a0a7eeb81b97
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/150018/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F150018%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F150018%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/150018/files
Reloadhttps://github.com/python/cpython/pull/150018/files
Reloadhttps://github.com/python/cpython/pull/150018/files
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.7k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
encukouhttps://github.com/encukou
python:mainhttps://github.com/python/cpython/tree/main
kiri11:ssl-rc-ft-49https://github.com/kiri11/cpython/tree/ssl-rc-ft-49
Conversation 13 https://github.com/python/cpython/pull/150018
Commits 12 https://github.com/python/cpython/pull/150018/commits
Checks 65 https://github.com/python/cpython/pull/150018/checks
Files changed 3 https://github.com/python/cpython/pull/150018/files
gh-149816: Fix SNI callback callable race https://github.com/python/cpython/pull/150018/files#top
Show all changes 12 commits https://github.com/python/cpython/pull/150018/files
89d0b19 Add test_sni_callback_race kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/89d0b197f130ca7ea4d287d5203142ffc6a1beff
be11d8b Improve test_sni_callback_race kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/be11d8b93ee5f84fd4afd7323397b39076f86c46
63d7bab Fix SNI callback callable race use-after-free kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/63d7bab79c15ccc1c0c4fee1bd8feda81779804d
806f3f1 Merge branch 'main' into ssl-rc-ft-49 kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/806f3f18efdd6b7560e8ddfa96a4dae3d0f7b079
1920fcb 📜🤖 Added by blurb_it. blurb-it[bot] May 18, 2026 https://github.com/python/cpython/pull/150018/commits/1920fcb967337d300bc7d329c0e5dae8876efe71
fb02f9d Reorder imports kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/fb02f9df3851a4d4f5fcfb0d44665e994fb4767e
dd20d00 Py_XDECREF in error case kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/dd20d000a5903f6e6fe92a18301a9185bd2a00cb
1548b6e Remove callback before Py_CLEAR kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/1548b6e900762d2110be0f530602827882bde538
67da443 Remove FT_ATOMIC_LOAD_PTR_RELAXED kiri11 May 18, 2026 https://github.com/python/cpython/pull/150018/commits/67da443971599f7bc89f0f3190e0db3783c81af2
1ecc7df Don't allow callback == NULL kiri11 May 19, 2026 https://github.com/python/cpython/pull/150018/commits/1ecc7df393f55354dd90a241dd09ee6256f94f5e
32e5ba4 Simplify test kiri11 May 19, 2026 https://github.com/python/cpython/pull/150018/commits/32e5ba4c2b70a7d8b3b7839977161e81fc0f504c
e1f1f4a Simplify exchange in critical section kiri11 May 19, 2026 https://github.com/python/cpython/pull/150018/commits/e1f1f4ad387acb97fa783901c26fc54e686b2216
Clear filters https://github.com/python/cpython/pull/150018/files
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
test_ssl.py https://github.com/python/cpython/pull/150018/files#diff-d526ded1c360bed6b222de46f4ca92b834f978ebed992fb3189bf9a94a198578
2026-05-18-22-45-54.gh-issue-149816.T68vc_.rst https://github.com/python/cpython/pull/150018/files#diff-e921c745e05c9a890bbaf97af556b520a6551a6a34e46a808d9dbf3fff84388b
_ssl.c https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L397
Lib/test/test_ssl.pyhttps://github.com/python/cpython/pull/150018/files#diff-d526ded1c360bed6b222de46f4ca92b834f978ebed992fb3189bf9a94a198578
View file https://github.com/kiri11/cpython/blob/e1f1f4ad387acb97fa783901c26fc54e686b2216/Lib/test/test_ssl.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/150018/{{ revealButtonHref }}
https://github.com/python/cpython/pull/150018/files#diff-d526ded1c360bed6b222de46f4ca92b834f978ebed992fb3189bf9a94a198578
https://github.com/python/cpython/pull/150018/files#diff-d526ded1c360bed6b222de46f4ca92b834f978ebed992fb3189bf9a94a198578
Misc/NEWS.d/next/Library/2026-05-18-22-45-54.gh-issue-149816.T68vc_.rsthttps://github.com/python/cpython/pull/150018/files#diff-e921c745e05c9a890bbaf97af556b520a6551a6a34e46a808d9dbf3fff84388b
View file https://github.com/kiri11/cpython/blob/e1f1f4ad387acb97fa783901c26fc54e686b2216/Misc/NEWS.d/next/Library/2026-05-18-22-45-54.gh-issue-149816.T68vc_.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/150018/{{ revealButtonHref }}
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L397
Modules/_ssl.chttps://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
View file https://github.com/kiri11/cpython/blob/e1f1f4ad387acb97fa783901c26fc54e686b2216/Modules/_ssl.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/150018/{{ revealButtonHref }}
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
encukouhttps://github.com/encukou
May 19, 2026https://github.com/python/cpython/pull/150018/files#r3263053960
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
kiri11https://github.com/kiri11
May 19, 2026https://github.com/python/cpython/pull/150018/files#r3263103365
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
kiri11https://github.com/kiri11
May 19, 2026https://github.com/python/cpython/pull/150018/files#r3263146077
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
https://github.com/python/cpython/pull/150018/files#diff-89879be484d86da4e77c90d5408b2e10190ee27cc86337cd0f8efc3520d60621
Please reload this pagehttps://github.com/python/cpython/pull/150018/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.