Closed Bug 1320577 Opened 9 years ago Closed 9 years ago

Assertion failure: 0, at ../../lib/ssl/tls13con.c:287

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ttaubert, Assigned: ttaubert)

References

(Blocks 1 open bug)

Details

(Keywords: sec-low)

Attachments

(1 file)

Assertion failure: 0, at ../../lib/ssl/tls13con.c:287 ==11788== ERROR: libFuzzer: deadly signal #0 0x4c9070 in __sanitizer_print_stack_trace /home/development/llvm/3.9.0/final/llvm.src/projects/compiler-rt/lib/asan/asan_stack.cc:38:3 #1 0x51c564 in fuzzer::Fuzzer::CrashCallback() /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:251:5 #2 0x51c523 in fuzzer::Fuzzer::StaticCrashSignalCallback() /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:240:6 #3 0x533708 in fuzzer::CrashHandler(int, siginfo_t*, void*) /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerUtil.cpp:81:3 #4 0x7f4b494b666f (/lib/x86_64-linux-gnu/libpthread.so.0+0x1166f) #5 0x7f4b48f0f7ee in gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x357ee) #6 0x7f4b48f113e9 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x373e9) #7 0x7f4b487b74b9 in PR_Assert /home/tim/workspace/nspr/Debug/pr/src/io/../../../../pr/src/io/prlog.c:553:5 #8 0x7f4b497aeec7 in tls13_GetHashSizeForHash /home/tim/workspace/nss/out/Debug/../../lib/ssl/tls13con.c:287:13 #9 0x7f4b497cf9f0 in tls13_ClientSendPreSharedKeyXtn /home/tim/workspace/nss/out/Debug/../../lib/ssl/tls13exthandle.c:477:13 #10 0x7f4b4976295a in ssl3_CallHelloExtensionSenders /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3ext.c:424:30 #11 0x7f4b49723f55 in ssl3_SendClientHello /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3con.c:5236:18 #12 0x7f4b4974fb61 in ssl3_HandleHelloRequest /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3con.c:5569:10 #13 0x7f4b4973b403 in ssl3_HandlePostHelloHandshakeMessage /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3con.c:11840:18 #14 0x7f4b49736af3 in ssl3_HandleHandshakeMessage /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3con.c:11798:22 #15 0x7f4b4973f5bc in ssl3_HandleHandshake /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3con.c:11986:18 #16 0x7f4b4973c478 in ssl3_HandleRecord /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3con.c:12754:22 #17 0x7f4b49771a6b in ssl3_GatherCompleteHandshake /home/tim/workspace/nss/out/Debug/../../lib/ssl/ssl3gthr.c:407:18 #18 0x7f4b4977b158 in ssl_GatherRecord1stHandshake /home/tim/workspace/nss/out/Debug/../../lib/ssl/sslcon.c:78:10 #19 0x7f4b4978514a in ssl_Do1stHandshake /home/tim/workspace/nss/out/Debug/../../lib/ssl/sslsecur.c:65:14 #20 0x7f4b49788709 in SSL_ForceHandshake /home/tim/workspace/nss/out/Debug/../../lib/ssl/sslsecur.c:414:14 #21 0x4ee916 in client_fuzzing_target /home/tim/workspace/nss/out/Debug/../../fuzz/client_target.cc:347:7 #22 0x51d4fb in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:515:13 #23 0x51d6a7 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:469:3 #24 0x51e57d in fuzzer::Fuzzer::MutateAndTestOne() /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:701:30 #25 0x51e837 in fuzzer::Fuzzer::Loop() /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:734:5 #26 0x51237a in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/tim/workspace/nss/out/Debug/../../fuzz/libFuzzer/FuzzerDriver.cpp:525:6 #27 0x508b1a in main /home/tim/workspace/nss/out/Debug/../../fuzz/nssfuzz.cc:147:10 #28 0x7f4b48efa3f0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x203f0) #29 0x420629 in _start (/home/tim/workspace/dist/Debug/bin/nssfuzz+0x420629) NOTE: libFuzzer has rudimentary signal handlers. Combine libFuzzer with AddressSanitizer or similar for better crash reports. SUMMARY: libFuzzer: deadly signal MS: 1 Custom-; base unit: fb2fc136119be8001485e9c853ef555ba5dc044d artifact_prefix='./'; Test unit written to ./crash-b53ff54f8ef79083aea7ebe433f3a71cfc10d1f5
Not sure yet what's going on here, or how to reproduce. Have to investigate.
Here's a test that reproduces the issue: > TEST_F(TlsConnectTest, FooBar) { > ConfigureSessionCache(RESUME_BOTH, RESUME_TICKET); > ConfigureVersion(SSL_LIBRARY_VERSION_TLS_1_3); > Connect(); > > SendReceive(); // Need to read so that we absorb the session tickets. > CheckKeys(); > > // Try resuming the connection. > Reset(); > ConfigureSessionCache(RESUME_BOTH, RESUME_TICKET); > client_->SetVersionRange(SSL_LIBRARY_VERSION_TLS_1_2, > SSL_LIBRARY_VERSION_TLS_1_3); > server_->SetVersionRange(SSL_LIBRARY_VERSION_TLS_1_2, > SSL_LIBRARY_VERSION_TLS_1_2); > Connect(); > > client_->PrepareForRenegotiate(); > server_->StartRenegotiate(); > Handshake(); > } We establish a 1.3 connection and receive a ticket. Then we try resuming this session but get downgraded to 1.2, which means we set ss->statelessResume=true and don't set it back when we see the SH. When we now get a HelloRequest we call tls13_ClientSendPreSharedKeyXtn() and run into the above assertion. This will probably be fixed by bug 1320093 too.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Depends on: 1320093
Fixed by bug 1320093.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.29
Group: crypto-core-security → core-security-release
Keywords: sec-low
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: