Skip to content

Conversation

@kwvg
Copy link
Collaborator

@kwvg kwvg commented Mar 17, 2022

Additional Notes

The fuzzing system has been more-or-less been a relatively unmaintained and untested portion of Dash Core, this PR aims to resolve that. As fuzzing targets haven't been tested with CI, malformed build files and code make their way into the codebase.

The following is implemented in this PR:

  • Fixes for broken fuzzing harnesses and malformed backports
  • Introduction of a fuzzing CI build to ensure that code is validated before merge
  • Introduction of clang into the Dash CI Docker image (needed for fuzzing)
  • Definition of formerly missing UBSAN_OPTIONS environment variable, addition of header to exemption list to mitigate build error. See below.
bls/bls.h:103:11: runtime error: downcast of address 0xff99c0c8 which does not point to an object of type 'CBLSSecretKey'
0xff99c0c8: note: object is of type 'CBLSWrapper<bls::PrivateKey, 32u, CBLSSecretKey>'
 74 f5 21 f7  b8 54 1f 60 01 b0 1f f7  08 ec ce f6 00 f5 21 f7  00 00 00 00 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~
              vptr for 'CBLSWrapper<bls::PrivateKey, 32u, CBLSSecretKey>'
    #0 0x5a6ceee7 in CBLSWrapper<bls::PrivateKey, 32u, CBLSSecretKey>::Reset() bls/bls.h:103
    #1 0x5a6ceee7 in CBLSWrapper<bls::PrivateKey, 32u, CBLSSecretKey>::SetByteVector(std::vector<unsigned char, std::allocator<unsigned char> > const&) bls/bls.h:114
    #2 0x5a6ceee7 in CBLSWrapper<bls::PrivateKey, 32u, CBLSSecretKey>::CBLSWrapper(std::vector<unsigned char, std::allocator<unsigned char> > const&, bool) bls/bls.h:64
    #3 0x5a6ceee7 in CBLSSecretKey::CBLSWrapper(std::vector<unsigned char, std::allocator<unsigned char> > const&, bool) bls/bls.h:235
    #4 0x5a6ceee7 in evo_simplifiedmns_tests::simplifiedmns_merkleroots::test_method() test/evo_simplifiedmns_tests.cpp:29
    #5 0x5a6d1ed9 in simplifiedmns_merkleroots_invoker test/evo_simplifiedmns_tests.cpp:15
    #6 0x5f8120a5 in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x92a50a5)
    #7 0x5f81054b in boost::execution_monitor::catch_signals(boost::function<int ()> const&) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x92a354b)
    #8 0x5f8105f0 in boost::execution_monitor::execute(boost::function<int ()> const&) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x92a35f0)
    #9 0x5f8106de in boost::execution_monitor::vexecute(boost::function<void ()> const&) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x92a36de)
    #10 0x5f7d57c8 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x92687c8)
    #11 0x5f7b639e in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x924939e)
    #12 0x5f7b6861 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x9249861)
    #13 0x5f7b6861 in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x9249861)
    #14 0x5f7accad in boost::unit_test::framework::run(unsigned long, bool) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x923fcad)
    #15 0x5f7d369c in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x926669c)
    #16 0x59bdef44 in main (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x3671f44)
    #17 0xf6fa2ee4 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x1aee4)
    #18 0x59be03b4 in _start (/builds/dashpay/dash/build-ci/dashcore-linux32_ubsan/src/test/test_dash+0x36733b4)

@kwvg kwvg force-pushed the fuzz_repairs branch 2 times, most recently from 3afe800 to b0459e8 Compare March 17, 2022 11:55
@kwvg kwvg marked this pull request as ready for review March 17, 2022 13:44
@kwvg kwvg requested review from PastaPastaPasta and UdjinM6 and removed request for UdjinM6 March 17, 2022 13:44
Copy link
Member

@PastaPastaPasta PastaPastaPasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fo merge via merge commit

Copy link

@UdjinM6 UdjinM6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, utACK

@UdjinM6 UdjinM6 added this to the 18 milestone Mar 23, 2022
@UdjinM6 UdjinM6 merged commit 15aceb9 into dashpay:develop Mar 23, 2022
@kwvg kwvg deleted the fuzz_repairs branch July 18, 2023 11:41
@UdjinM6 UdjinM6 mentioned this pull request Dec 12, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants