Skip to content

Conversation

practicalswift
Copy link
Contributor

Add fuzzing harnesses for various Base{32,58,64} and hex related functions.

Testing this PR

Run:

$ CC=clang CXX=clang++ ./configure --enable-fuzz \
      --with-sanitizers=address,fuzzer,undefined
$ make
$ src/test/fuzz/base_encode_decode
…
$ src/test/fuzz/hex
…

@practicalswift practicalswift force-pushed the fuzzers-base_encode_decode branch 2 times, most recently from 728a7b7 to 59f7c87 Compare October 23, 2019 15:39
@fanquake fanquake added the Tests label Oct 23, 2019
@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 23, 2019

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #17071 (tests: Add fuzzing harness for CheckBlock(...) and other CBlock related functions by practicalswift)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@practicalswift
Copy link
Contributor Author

Rebased! :)

@practicalswift practicalswift force-pushed the fuzzers-base_encode_decode branch from c6a2063 to 370c0da Compare December 9, 2019 20:26
@practicalswift
Copy link
Contributor Author

Rebased! :)

@practicalswift practicalswift force-pushed the fuzzers-base_encode_decode branch 5 times, most recently from 2557f6d to 8c1c321 Compare December 11, 2019 10:20
@practicalswift practicalswift force-pushed the fuzzers-base_encode_decode branch from 8c1c321 to c8b3595 Compare December 12, 2019 10:44
@maflcko
Copy link
Member

maflcko commented Dec 17, 2019

ACK c184057 🔁

Show signature and timestamp

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

ACK c18405732e38eadb2c47533c3f982f4605fbfd9a 🔁
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUiRkQwAzifZDinuiY69gCNY7zItA/6qtOrQCr5xI9XT/cXhnmxujZ3kUOhV6Up4
5TURghwN8nPvmhoGQGRUdLKcRIukT7fOpY4nm4ZUF1ixP+ptU76tqMRvbEvmW7+n
cJFiQdRf6orw4BQDmzs8Mn6bAzbDy0R6rZQaVOOWC3t8gm5GYxgyxF1GCaaCiObN
1RCHk7w/cPtECYtF/jn6mGQ+x1QjFTnM4jfE6eoZ4MK8ZQQH83KpPHFbaDkUdZVr
JDDTgj36fvZDMG5lHwq3Kl1H4n6935gnn5scpg/RJDBWR/b6/OtDWbOgD5NKYeB0
TxYzEOcvc2VZMHniZY+0U5QGG1V2E4b2i8VTXKprvS78HFFBHGBFaEs0x8Khw++y
6PiMm5pl5NNsrupqhFZjKok1ovcYhdW/R20UUenuoreBdNxn2gbxHusrby7fqyLU
Mh1EjobV9+2j6hoq31RruhDhEEci9hGYQIkViGxp9WE30zIQnfMaydWK8WXqo2j9
mzRQTJm4
=fMYZ
-----END PGP SIGNATURE-----

Timestamp of file with hash f74c2496a35f1208847a8485a6f49081e34fb06b514fa83512932463fc23f7a6 -

maflcko pushed a commit that referenced this pull request Dec 17, 2019
… and hex related functions

c184057 tests: Add fuzzing harness for various hex related functions (practicalswift)
526dd78 tests: Add fuzzing harness for various Base{32,58,64} related functions (practicalswift)
32e2712 util: Move TrimString(...). Introduce default pattern (trims whitespace). Add NODISCARD. (practicalswift)
22d9bae tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus (practicalswift)

Pull request description:

  Add fuzzing harnesses for various Base{32,58,64} and hex related functions.

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz \
        --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/base_encode_decode
  …
  $ src/test/fuzz/hex
  …
  ```

ACKs for top commit:
  MarcoFalke:
    ACK c184057 🔁

Tree-SHA512: 4fcbe4f641fc553e43fd5c3c40a6beec0d2ce90c5ffc718213b37fc18aba4c055e51e26f93d01ea1248fd89473d07c9dce77db7f014b47d3abd045f61b5f1905
@maflcko maflcko merged commit c184057 into bitcoin:master Dec 17, 2019
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 17, 2019
…,58,64} and hex related functions

c184057 tests: Add fuzzing harness for various hex related functions (practicalswift)
526dd78 tests: Add fuzzing harness for various Base{32,58,64} related functions (practicalswift)
32e2712 util: Move TrimString(...). Introduce default pattern (trims whitespace). Add NODISCARD. (practicalswift)
22d9bae tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus (practicalswift)

Pull request description:

  Add fuzzing harnesses for various Base{32,58,64} and hex related functions.

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz \
        --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/base_encode_decode
  …
  $ src/test/fuzz/hex
  …
  ```

ACKs for top commit:
  MarcoFalke:
    ACK c184057 🔁

Tree-SHA512: 4fcbe4f641fc553e43fd5c3c40a6beec0d2ce90c5ffc718213b37fc18aba4c055e51e26f93d01ea1248fd89473d07c9dce77db7f014b47d3abd045f61b5f1905
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

ACK c184057 - code review and tested on master posthumously 🏃‍♂️

bitcoin/bitcoin (master)$ src/test/fuzz/base_encode_decode
INFO: Seed: 1034069505
INFO: Loaded 1 modules   (5201 inline 8-bit counters): 5201 [0x559140d7b920, 0x559140d7cd71), 
INFO: Loaded 1 PC tables (5201 PCs): 5201 [0x559140d7cd78,0x559140d91288), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2	INITED cov: 451 ft: 452 corp: 1/1b lim: 4 exec/s: 0 rss: 41Mb
#3	NEW    cov: 460 ft: 557 corp: 2/3b lim: 4 exec/s: 0 rss: 41Mb L: 2/2 MS: 1 InsertByte-
#5	NEW    cov: 460 ft: 559 corp: 3/5b lim: 4 exec/s: 0 rss: 41Mb L: 2/2 MS: 2 ShuffleBytes-CopyPart-
#7	NEW    cov: 461 ft: 560 corp: 4/7b lim: 4 exec/s: 0 rss: 41Mb L: 2/2 MS: 2 ShuffleBytes-ChangeBit-
bitcoin/bitcoin (master)$ src/test/fuzz/hex
INFO: Seed: 1110008671
INFO: Loaded 1 modules   (3630 inline 8-bit counters): 3630 [0x5602274bbe40, 0x5602274bcc6e), 
INFO: Loaded 1 PC tables (3630 PCs): 3630 [0x5602274bcc70,0x5602274caf50), 
INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes
INFO: A corpus is not provided, starting from an empty corpus
#2	INITED cov: 176 ft: 177 corp: 1/1b lim: 4 exec/s: 0 rss: 41Mb
#5	NEW    cov: 183 ft: 197 corp: 2/3b lim: 4 exec/s: 0 rss: 41Mb L: 2/2 MS: 3 ShuffleBytes-ShuffleBytes-InsertByte-
#6	NEW    cov: 183 ft: 198 corp: 3/5b lim: 4 exec/s: 0 rss: 41Mb L: 2/2 MS: 1 InsertByte-
#7	NEW    cov: 184 ft: 212 corp: 4/7b lim: 4 exec/s: 0 rss: 41Mb L: 2/2 MS: 1 ShuffleBytes-

MarkLTZ added a commit to litecoinz-core/litecoinz that referenced this pull request Apr 9, 2020
- rpc/wallet: initialize nFeeRequired to avoid using garbage value on failure bitcoin#18274
- httpserver: use own HTTP status codes bitcoin#18168
- tests: Add fuzzing harnesses for various Base{32,58,64} and hex related functions bitcoin#17229
- util: Don't allow Base32/64-decoding or ParseMoney(…) on strings with embedded NUL characters. Add tests. bitcoin#17753
- util: Fail to parse empty string in ParseMoney bitcoin#18225
- util: Fail to parse whitespace-only strings in ParseMoney(...) (instead of parsing as zero) bitcoin#18270
- Replace the LogPrint function with a macro bitcoin#17218
- Fix wallet unload race condition bitcoin#18338
- qt: Fix Window -> Minimize menu item bitcoin#18549
- windows: Enable heap terminate-on-corruption bitcoin#17916
jasonbcox pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Oct 28, 2020
…ed functions

Summary:
```
Add fuzzing harnesses for various Base{32,58,64} and hex related
functions.
```

Backport of core [[bitcoin/bitcoin#17229 | PR17229]].

The missing corpora change is irrelevant for us.

Depends on D8155.

Test Plan:
  ninja bitcoin-fuzzers
  ./test/fuzz/test_runner.py <path_to_corpus>

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D8156
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
…,58,64} and hex related functions

c184057 tests: Add fuzzing harness for various hex related functions (practicalswift)
526dd78 tests: Add fuzzing harness for various Base{32,58,64} related functions (practicalswift)
32e2712 util: Move TrimString(...). Introduce default pattern (trims whitespace). Add NODISCARD. (practicalswift)
22d9bae tests: Add corpora suppression (FUZZERS_MISSING_CORPORA) for fuzzers missing in https://github.com/bitcoin-core/qa-assets/tree/master/fuzz_seed_corpus (practicalswift)

Pull request description:

  Add fuzzing harnesses for various Base{32,58,64} and hex related functions.

  **Testing this PR**

  Run:

  ```
  $ CC=clang CXX=clang++ ./configure --enable-fuzz \
        --with-sanitizers=address,fuzzer,undefined
  $ make
  $ src/test/fuzz/base_encode_decode
  …
  $ src/test/fuzz/hex
  …
  ```

ACKs for top commit:
  MarcoFalke:
    ACK c184057 🔁

Tree-SHA512: 4fcbe4f641fc553e43fd5c3c40a6beec0d2ce90c5ffc718213b37fc18aba4c055e51e26f93d01ea1248fd89473d07c9dce77db7f014b47d3abd045f61b5f1905
@practicalswift practicalswift deleted the fuzzers-base_encode_decode branch April 10, 2021 19:39
kwvg added a commit to kwvg/dash that referenced this pull request May 25, 2021
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request May 28, 2021
kwvg added a commit to kwvg/dash that referenced this pull request Feb 27, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Feb 27, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Feb 28, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Feb 28, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Feb 28, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Mar 13, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Mar 24, 2022
gades pushed a commit to cosanta/cosanta-core that referenced this pull request Apr 26, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants