fuzz: Fix wallet_bdb_parser 32-bit unhandled fseek error #30307

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2406-fuzz-wallet-bdb-32 changing 1 files +2 −1
  1. maflcko commented at 11:33 am on June 19, 2024: member

    std::fseek on 64-bit past the end of the file may work fine (the following read would fail). However, on 32-bit it may fail early.

    Fix it, by ignoring the error, treating it similar to a read error.

    This was found by OSS-Fuzz.

    https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=69414

  2. DrahtBot commented at 11:33 am on June 19, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK TheCharlatan, brunoerg

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Tests on Jun 19, 2024
  4. fuzz: Fix wallet_bdb_parser 32-bit unhandled fseek error fa7bc9bbca
  5. maflcko force-pushed on Jun 19, 2024
  6. maflcko commented at 11:40 am on June 19, 2024: member

    Example:

    0$ base64 ~/Downloads/clusterfuzz-testcase-minimized-wallet_bdb_parser-5937261974716416 
    1ICD//yAgICAAAAAAAAUxYgAAAAkAAAIAAAkgICAgICAAAAAAICAgICAgICAgICAgAAAAIP//ICAg
    2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICD/ICAgICAg////////ICAgICAgICAgICAg
    3ICAgICAgICAgICAgICAgICAgICAgICAg////ICD//yAgICAgICAgICAgICAgICAgICAg////////
    4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg////ICAgICAgICAgICAgICAgICAg
    5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIP///yAgICAg
    6ICAgICAg////IP//////ICAgICAgICAg//8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
    7ICAgICAgICAgICAgICAgICAgICD///8g//////8gICAgICAgICD//yAgICAgICAgICAgICAgICAg
    8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg////ICAgIP//IP//////ICAgICAg
    9ICAg//8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA=
    

    To test locally:

    0CONFIG_SITE="$PWD/depends/i686-pc-linux-gnu/share/config.site" ./configure  --enable-fuzz --with-sanitizers=fuzzer && make clean && make  -j $(nproc)
    1FUZZ=wallet_bdb_parser ./src/test/fuzz/fuzz -runs=1 /tmp/c
    

    Before:

    0terminate called after throwing an instance of 'std::runtime_error'
    1  what():  AutoFile::seek: fseek failed: iostream error
    

    After:

    (Passes)

  7. TheCharlatan approved
  8. TheCharlatan commented at 1:50 pm on June 19, 2024: contributor
    ACK fa7bc9bbca9348cf31b97bee0789ea7caeec635c
  9. brunoerg approved
  10. brunoerg commented at 6:59 pm on June 19, 2024: contributor
    utACK fa7bc9bbca9348cf31b97bee0789ea7caeec635c
  11. fanquake merged this on Jun 20, 2024
  12. fanquake closed this on Jun 20, 2024

  13. maflcko deleted the branch on Jun 20, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-06-29 04:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me