If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

UBSan: DataBuffer::Write(): null pointer passed as argument 2, which is declared to never be null

RESOLVED FIXED in 3.28

Status

NSS
Libraries
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: ttaubert, Assigned: ttaubert)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Assignee)

Description

a year ago
databuffer.h:70:39: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:43:28: note: nonnull attribute specified here
    #0 0x5a99e3 in nss_test::DataBuffer::Write(unsigned long, unsigned char const*, unsigned long) /home/worker/nss/external_tests/ssl_gtest/./databuffer.h:70:7
    #1 0x587d1f in nss_test::DataBuffer::Write(unsigned long, unsigned int, unsigned long) /home/worker/nss/external_tests/ssl_gtest/./databuffer.h:93:12
    #2 0xb1875d in nss_test::TlsAgentTestBase::MakeHandshakeMessageFragment(unsigned char, unsigned char const*, unsigned long, nss_test::DataBuffer*, unsigned long, unsigned int, unsigned int) const /home/worker/nss/external_tests/ssl_gtest/tls_agent.cc:884:16
    #3 0xb18679 in nss_test::TlsAgentTestBase::MakeHandshakeMessage(unsigned char, unsigned char const*, unsigned long, nss_test::DataBuffer*, unsigned long) const /home/worker/nss/external_tests/ssl_gtest/tls_agent.cc:874:10
    #4 0x58a0ab in nss_test::TlsAgentStreamTestClient_EncryptedExtensionsInClearTwoPieces_Test::TestBody() /home/worker/nss/external_tests/ssl_gtest/ssl_agent_unittest.cc:119:3
    #5 0xd56dde in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2362:10
    #6 0xc4482d in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2398:14
    #7 0xc43b80 in testing::Test::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2434:5
    #8 0xc4abe2 in testing::TestInfo::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2610:11
    #9 0xc51dcf in testing::TestCase::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2728:28
    #10 0xc8eb1b in testing::internal::UnitTestImpl::RunAllTests() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:4591:43
    #11 0xd6f340 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2362:10
    #12 0xc8bd9d in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2398:14
    #13 0xc8b4ce in testing::UnitTest::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:4209:10
    #14 0x91aa5c in RUN_ALL_TESTS() /home/worker/nss/external_tests/ssl_gtest/../../external_tests/google_test/gtest/include/gtest/gtest.h:2304:46
    #15 0x91a8e2 in main /home/worker/nss/external_tests/ssl_gtest/ssl_gtest.cc:37:12
    #16 0x7f84c9e0f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #17 0x46e2d8 in _start (/home/worker/nss/external_tests/ssl_gtest/Linux4.1_x86_64_clang-3.9_glibc_PTH_64_ASAN_DBG.OBJ/ssl_gtest+0x46e2d8)

databuffer.h:70:39: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:43:28: note: nonnull attribute specified here
    #0 0x5a9c13 in nss_test::DataBuffer::Write(unsigned long, unsigned char const*, unsigned long) /home/worker/nss/external_tests/ssl_gtest/./databuffer.h:70:7
    #1 0x587f4f in nss_test::DataBuffer::Write(unsigned long, unsigned int, unsigned long) /home/worker/nss/external_tests/ssl_gtest/./databuffer.h:93:12
    #2 0xbdbfb4 in nss_test::TlsRecordFilter::RecordHeader::Write(nss_test::DataBuffer*, unsigned long, nss_test::DataBuffer const&) const /home/worker/nss/external_tests/ssl_gtest/tls_filter.cc:107:20
    #3 0xbe9930 in nss_test::AfterRecordN::FilterRecord(nss_test::TlsRecordFilter::RecordHeader const&, nss_test::DataBuffer const&, nss_test::DataBuffer*) /home/worker/nss/external_tests/ssl_gtest/tls_filter.cc:455:12
    #4 0xbdcb5c in nss_test::TlsRecordFilter::FilterRecord(nss_test::TlsRecordFilter::RecordHeader const&, nss_test::DataBuffer const&, unsigned long*, nss_test::DataBuffer*) /home/worker/nss/external_tests/ssl_gtest/tls_filter.cc:57:33
    #5 0xbdad4b in nss_test::TlsRecordFilter::Filter(nss_test::DataBuffer const&, nss_test::DataBuffer*) /home/worker/nss/external_tests/ssl_gtest/tls_filter.cc:35:9
    #6 0xa7c9cc in nss_test::DummyPrSocket::Write(void const*, int) /home/worker/nss/external_tests/ssl_gtest/test_io.cc:384:23
    #7 0xa8768b in nss_test::DummyWrite(PRFileDesc*, void const*, int) /home/worker/nss/external_tests/ssl_gtest/test_io.cc:69:14
    #8 0xa893d5 in nss_test::DummySend(PRFileDesc*, void const*, int, int, unsigned int) /home/worker/nss/external_tests/ssl_gtest/test_io.cc:162:21
    #9 0xed1453 in ssl_DefSend /home/worker/nss/lib/ssl/ssldef.c:103:18
    #10 0xf25b2d in ssl_SendSavedWriteData /home/worker/nss/lib/ssl/sslsecur.c:519:14
    #11 0xdffbe5 in ssl3_SendClientHello /home/worker/nss/lib/ssl/ssl3con.c:5399:16
    #12 0x104d89a in ssl_BeginClientHandshake /home/worker/nss/lib/ssl/sslcon.c:204:10
    #13 0xf1949a in ssl_Do1stHandshake /home/worker/nss/lib/ssl/sslsecur.c:65:14
    #14 0xf24fec in SSL_ForceHandshake /home/worker/nss/lib/ssl/sslsecur.c:411:14
    #15 0xb0d836 in nss_test::TlsAgent::Handshake() /home/worker/nss/external_tests/ssl_gtest/tls_agent.cc:668:18
    #16 0xb4d553 in nss_test::TlsConnectTestBase::Handshake() /home/worker/nss/external_tests/ssl_gtest/tls_connect.cc:239:12
    #17 0xb63a5d in nss_test::TlsConnectTestBase::ConnectExpectFail() /home/worker/nss/external_tests/ssl_gtest/tls_connect.cc:327:3
    #18 0x552987 in nss_test::TlsConnectTest_DamageSecretHandleZeroRttClientFinished_Test::TestBody() /home/worker/nss/external_tests/ssl_gtest/ssl_0rtt_unittest.cc:191:3
    #19 0xd5d6ce in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2362:10
    #20 0xc4b11d in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2398:14
    #21 0xc4a470 in testing::Test::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2434:5
    #22 0xc514d2 in testing::TestInfo::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2610:11
    #23 0xc586bf in testing::TestCase::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2728:28
    #24 0xc9540b in testing::internal::UnitTestImpl::RunAllTests() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:4591:43
    #25 0xd75c30 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2362:10
    #26 0xc9268d in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:2398:14
    #27 0xc91dbe in testing::UnitTest::Run() /home/worker/nss/external_tests/google_test/gtest/src/gtest.cc:4209:10
    #28 0x91debc in RUN_ALL_TESTS() /home/worker/nss/external_tests/ssl_gtest/../../external_tests/google_test/gtest/include/gtest/gtest.h:2304:46
    #29 0x91dd42 in main /home/worker/nss/external_tests/ssl_gtest/ssl_gtest.cc:37:12
    #30 0x7f22fefa182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #31 0x46e528 in _start (/home/worker/nss/external_tests/ssl_gtest/Linux4.1_x86_64_clang-3.9_glibc_PTH_64_ASAN_DBG.OBJ/ssl_gtest+0x46e528)
(Assignee)

Comment 1

a year ago
https://nss-dev.phacility.com/D50
Flags: needinfo?(martin.thomson)
Flags: needinfo?(ekr)
(Assignee)

Comment 2

a year ago
https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=a8523aff0e838445702eabf5c0351b46af094672
(Assignee)

Comment 3

a year ago
https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=2c7c7ad5f40ef131d453f4173851ca81eb2ce3db
(Assignee)

Comment 4

a year ago
https://treeherder.mozilla.org/#/jobs?repo=nss-try&revision=64525b5cefddb5daf5003d7c3dae0061fe32b6b4
(Assignee)

Comment 5

a year ago
https://hg.mozilla.org/projects/nss/rev/22b360240fac
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Flags: needinfo?(martin.thomson)
Flags: needinfo?(ekr)
Resolution: --- → FIXED
Target Milestone: --- → 3.28
You need to log in before you can comment on or make changes to this bug.