Skip to content

Conversation

practicalswift
Copy link
Contributor

@practicalswift practicalswift commented Jan 14, 2020

Add key_io fuzzing harness.

Fuzz additional functions in the hex fuzzing harness.

Fuzz additional functions in the integer fuzzing harness.

Fuzz additional functions in the script fuzzing harness.

Fuzz additional functions in the transaction fuzzing harness.

How to test this PR

$ make distclean
$ ./autogen.sh
$ CC=clang CXX=clang++ ./configure --enable-fuzz \
      --with-sanitizers=address,fuzzer,undefined
$ make
$ src/test/fuzz/key_io
…

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 15, 2020

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

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! :)

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

ACK. LGTM

@practicalswift
Copy link
Contributor Author

@MarcoFalke Thanks for great feedback. All feedback addressed. Please re-review :)

Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

ACK 52fed69 🛫

Show signature and timestamp

Signature:

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

ACK 52fed696d251dc38211eb2fa7f144b6a989dd479 🛫
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUjJ3Av9FMRINKzkOdtiO6hfUiEY9evAs+3IVzuGJxrFAbS1j2HGPK1lgpw9QXPX
I7QMERrzBEMuV7Rz+i38qS26YMGfZAaUadFfg/BMyuwNh4z1DjhPR9Uas/JBkXjZ
yE/mZ4tT8mX4iKR/UXmQBEGzRkVFug8HEWVax1iQcwiKWbx4vAaJwuvfd3DhfROv
Cb1Qb1qM0z4RDivnXpOhwfpBL/8jrDikLM7vHWY2TzSQq3GJ8acvAOVXg60LqxmL
xtrjY8sNE13aowtElHuOUplHh43GLJXPj3ZkxOV0OyBgnYl8iP2cN4ns9UnUX+EQ
4c9d6U17cePisqsOVtw0BaKskAtwFA9A2o3VeGaOGb3wYOzfaB02oIqEbQ1lH1Ii
gG+2O6Lr5c3oMtBS8dCU+YXnHsu0pHfHzw+VQ+YZRpeH829Brq6M0UUqFErBDfY6
9L4DamTLo/ROVX/BT7zzBbgMLveLXjRnH8Zzx7SM7xepVjuO8QTTdAzl9IDf6lC0
UWm8QYGJ
=rsX8
-----END PGP SIGNATURE-----

vch.insert(vch.end(), buffer.begin(), buffer.end());
CScript decompressed_script;
(void)DecompressScript(decompressed_script, size, vch);
}
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you accidentally added a unit test here? This does not depend on any fuzz input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@MarcoFalke Are you sure about that? vch is built from buffer which is built from fuzz input, no? :)

Copy link
Member

Choose a reason for hiding this comment

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

buffer is only appened to vch, but pratically never read. Only the beginning of vch (20 or 32 bytes) are read, and they are all constant (zero). So this does never read any fuzz input, except for copying into the vector.

I suggest to remove this for loop and content.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix. Thanks for the ping :)

@maflcko maflcko merged commit 5e12a61 into bitcoin:master Mar 7, 2020
maflcko pushed a commit that referenced this pull request Mar 9, 2020
fab0e5b fuzz: Add assert(script == decompressed_script) (MarcoFalke)

Pull request description:

  Presumably an oversight in #17926 (comment)

ACKs for top commit:
  practicalswift:
    Tested ACK fab0e5b

Tree-SHA512: 6dcec06169df497a540fd6ebbcd89f5db22257241b2bbe756de868742f9bc324b80d38dbababfa07e5f3a830aaae9fc6d168dcc2ca5d75da437bdf4dc4e0f370
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 9, 2020
fab0e5b fuzz: Add assert(script == decompressed_script) (MarcoFalke)

Pull request description:

  Presumably an oversight in bitcoin#17926 (comment)

ACKs for top commit:
  practicalswift:
    Tested ACK fab0e5b

Tree-SHA512: 6dcec06169df497a540fd6ebbcd89f5db22257241b2bbe756de868742f9bc324b80d38dbababfa07e5f3a830aaae9fc6d168dcc2ca5d75da437bdf4dc4e0f370
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 5, 2020
…ing fuzzing harnesses.

Summary:
```
Add key_io fuzzing harness.

Fuzz additional functions in the hex fuzzing harness.

Fuzz additional functions in the integer fuzzing harness.

Fuzz additional functions in the script fuzzing harness.

Fuzz additional functions in the transaction fuzzing harness.
```

Backport of core [[bitcoin/bitcoin#17926 | PR17926]].

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

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8267
sidhujag pushed a commit to syscoin-core/syscoin that referenced this pull request Nov 10, 2020
fab0e5b fuzz: Add assert(script == decompressed_script) (MarcoFalke)

Pull request description:

  Presumably an oversight in bitcoin#17926 (comment)

ACKs for top commit:
  practicalswift:
    Tested ACK fab0e5b

Tree-SHA512: 6dcec06169df497a540fd6ebbcd89f5db22257241b2bbe756de868742f9bc324b80d38dbababfa07e5f3a830aaae9fc6d168dcc2ca5d75da437bdf4dc4e0f370
@practicalswift practicalswift deleted the fuzzers-key_io-etc branch April 10, 2021 19:40
kwvg added a commit to kwvg/dash that referenced this pull request May 7, 2022
kwvg added a commit to kwvg/dash that referenced this pull request May 7, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jun 14, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jun 14, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jun 18, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jul 4, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jul 4, 2022
kwvg added a commit to kwvg/dash that referenced this pull request Jul 6, 2022
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Jul 17, 2022
fab0e5b fuzz: Add assert(script == decompressed_script) (MarcoFalke)

Pull request description:

  Presumably an oversight in bitcoin#17926 (comment)

ACKs for top commit:
  practicalswift:
    Tested ACK fab0e5b

Tree-SHA512: 6dcec06169df497a540fd6ebbcd89f5db22257241b2bbe756de868742f9bc324b80d38dbababfa07e5f3a830aaae9fc6d168dcc2ca5d75da437bdf4dc4e0f370
knst pushed a commit to knst/dash that referenced this pull request Jul 21, 2022
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 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.

4 participants