Closed Bug 1322432 Opened 9 years ago Closed 9 years ago

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

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ttaubert, Assigned: ttaubert)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Assertion failure: 0, at ../../lib/ssl/tls13con.c:178 ==6468== ERROR: libFuzzer: deadly signal #0 0x4c5bc0 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 0x50cd44 in fuzzer::Fuzzer::CrashCallback() /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:251:5 #2 0x50cd03 in fuzzer::Fuzzer::StaticCrashSignalCallback() /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:240:6 #3 0x51e0a8 in fuzzer::CrashHandler(int, siginfo_t*, void*) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerUtil.cpp:81:3 #4 0x7f01977243df (/lib/x86_64-linux-gnu/libpthread.so.0+0x113df) #5 0x7f019717b427 in gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35427) #6 0x7f019717d029 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x37029) #7 0x7f0196a04e99 in PR_Assert /home/worker/nspr/Debug/pr/src/io/../../../../pr/src/io/prlog.c:553:5 #8 0x7f0197a2a188 in tls13_HandshakeState /home/worker/nss/out/Debug/../../lib/ssl/tls13con.c:178:5 #9 0x7f0197a3a4ad in tls13_CheckHsState /home/worker/nss/out/Debug/../../lib/ssl/tls13con.c:249:5 #10 0x7f0197a398b0 in tls13_HandleHelloRetryRequest /home/worker/nss/out/Debug/../../lib/ssl/tls13con.c:1736:10 #11 0x7f01979aba7d in ssl3_HandlePostHelloHandshakeMessage /home/worker/nss/out/Debug/../../lib/ssl/ssl3con.c:11874:18 #12 0x7f01979a6bea in ssl3_HandleHandshakeMessage /home/worker/nss/out/Debug/../../lib/ssl/ssl3con.c:11826:22 #13 0x7f01979b0534 in ssl3_HandleHandshake /home/worker/nss/out/Debug/../../lib/ssl/ssl3con.c:12014:18 #14 0x7f01979ace42 in ssl3_HandleRecord /home/worker/nss/out/Debug/../../lib/ssl/ssl3con.c:12782:22 #15 0x7f01979e7b67 in ssl3_GatherCompleteHandshake /home/worker/nss/out/Debug/../../lib/ssl/ssl3gthr.c:474:22 #16 0x7f01979f2102 in ssl_GatherRecord1stHandshake /home/worker/nss/out/Debug/../../lib/ssl/sslcon.c:78:10 #17 0x7f01979fd160 in ssl_Do1stHandshake /home/worker/nss/out/Debug/../../lib/ssl/sslsecur.c:65:14 #18 0x7f0197a00c8e in SSL_ForceHandshake /home/worker/nss/out/Debug/../../lib/ssl/sslsecur.c:414:14 #19 0x4ed1e7 in client_fuzzing_target /home/worker/nss/out/Debug/../../fuzz/client_target.cc:557:10 #20 0x50dd5d in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:518:13 #21 0x50df75 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerLoop.cpp:472:3 #22 0x505b7c in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerDriver.cpp:272:6 #23 0x507d50 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/worker/nss/out/Debug/../../fuzz/libFuzzer/FuzzerDriver.cpp:482:9 #24 0x50065a in main /home/worker/nss/out/Debug/../../fuzz/nssfuzz.cc:151:10 #25 0x7f019716682f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f) #26 0x41d178 in _start (/home/worker/dist/Debug/bin/nssfuzz+0x41d178)
Group: crypto-core-security
Keywords: sec-low
Attached file ssl trace log —
What's going on here is that we are getting an HRR when we are in TLS 1.2 mode and so we are in a TLS 1.2 state which isn't in our state list, at: tls13_HandshakeState(SSL3WaitState st) { switch (st) { STATE_CASE(wait_client_hello); STATE_CASE(wait_client_cert); STATE_CASE(wait_cert_verify); STATE_CASE(wait_finished); STATE_CASE(wait_server_hello); STATE_CASE(wait_server_cert); STATE_CASE(wait_cert_request); STATE_CASE(wait_encrypted_extensions); STATE_CASE(idle_handshake); default: break; } PORT_Assert(0); return "unknown"; } I think the right fix is to just add the TLS 1.2 states here, since this is just a printer. CHECK_HS_STATE should have errored out right after this, and we should check that with the fuzzer.
Attachment #8817290 - Attachment mime type: text/x-log → text/plain
Not a security bug, we only hit this when running with SSLTRACE=.
Group: crypto-core-security
Keywords: sec-low
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.29
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: