bitcoin/src
MarcoFalke a421e0a22f
Merge #18376: net: fix use-after-free in tests
7d8e1dec3b net: fix use-after-free in tests (Vasil Dimov)

Pull request description:

  In PeerLogicValidation::PeerLogicValidation() we would schedule a lambda
  function to execute later, capturing the local variable
  `consensusParams` by reference.

  Presumably this was considered safe because `consensusParams` is a
  reference itself to a global variable which is not supposed to change,
  but it can in tests.

  Fixes https://github.com/bitcoin/bitcoin/issues/18372

  <!--
  *** Please remove the following help text before submitting: ***

  Pull requests without a rationale and clear improvement may be closed
  immediately.
  -->

  <!--
  Please provide clear motivation for your patch and explain how it improves
  Bitcoin Core user experience or Bitcoin Core developer experience
  significantly:

  * Any test improvements or new tests that improve coverage are always welcome.
  * All other changes should have accompanying unit tests (see `src/test/`) or
    functional tests (see `test/`). Contributors should note which tests cover
    modified code. If no tests exist for a region of modified code, new tests
    should accompany the change.
  * Bug fixes are most welcome when they come with steps to reproduce or an
    explanation of the potential issue as well as reasoning for the way the bug
    was fixed.
  * Features are welcome, but might be rejected due to design or scope issues.
    If a feature is based on a lot of dependencies, contributors should first
    consider building the system outside of Bitcoin Core, if possible.
  * Refactoring changes are only accepted if they are required for a feature or
    bug fix or otherwise improve developer experience significantly. For example,
    most "code style" refactoring changes require a thorough explanation why they
    are useful, what downsides they have and why they *significantly* improve
    developer experience or avoid serious programming bugs. Note that code style
    is often a subjective matter. Unless they are explicitly mentioned to be
    preferred in the [developer notes](/doc/developer-notes.md), stylistic code
    changes are usually rejected.
  -->

  <!--
  Bitcoin Core has a thorough review process and even the most trivial change
  needs to pass a lot of eyes and requires non-zero or even substantial time
  effort to review. There is a huge lack of active reviewers on the project, so
  patches often sit for a long time.
  -->

ACKs for top commit:
  sipa:
    ACK 7d8e1dec3b
  practicalswift:
    ACK 7d8e1dec3b
  MarcoFalke:
    ACK 7d8e1dec3b

Tree-SHA512: fe0f6e5fac1976d38dfb249517eef142dcb8837e178d7d199e5e854e3ab428822c6da9d96fe312293d39b6c6cac0c97896f3b5760013db200cccd729ae1b0710
2020-03-18 16:40:47 -04:00
..
bench Merge #16902: O(1) OP_IF/NOTIF/ELSE/ENDIF script implementation 2020-03-14 21:03:45 +01:00
compat
config
consensus Update merkle.cpp 2020-03-18 10:34:53 -07:00
crc32c
crypto
index
interfaces Replace GetSigningProvider with GetSolvingProvider 2020-03-09 11:16:20 -04:00
leveldb
logging
node
policy
primitives
qt qt: Periodical translations update 2020-03-16 10:51:11 +01:00
rpc Merge #18346: rpc: Document an RPCResult for all calls; Enforce at compile time 2020-03-16 18:04:08 +01:00
script Merge #16902: O(1) OP_IF/NOTIF/ELSE/ENDIF script implementation 2020-03-14 21:03:45 +01:00
secp256k1
support
test Merge #18155: tests: Add harness which fuzzes EvalScript and VerifyScript using a fuzzed signature checker 2020-03-18 15:48:27 -04:00
univalue
util
wallet Merge #18289: refactor: Make scheduler methods type safe 2020-03-17 16:34:53 -04:00
zmq
.clang-format
Makefile.am
Makefile.bench.include
Makefile.crc32c.include
Makefile.leveldb.include
Makefile.qt.include
Makefile.qt_locale.include
Makefile.qttest.include
Makefile.test.include tests: Add harness which fuzzes EvalScript and VerifyScript using a fuzzed signature checker 2020-03-17 19:10:59 +00:00
Makefile.test_util.include
addrdb.cpp
addrdb.h
addrman.cpp
addrman.h
amount.h
arith_uint256.cpp
arith_uint256.h
attributes.h
banman.cpp
banman.h refactor: move DUMP_BANS_INTERVAL to banman.h 2020-03-10 09:52:53 -04:00
base58.cpp
base58.h
bech32.cpp
bech32.h
bitcoin-cli-res.rc
bitcoin-cli.cpp
bitcoin-tx-res.rc
bitcoin-tx.cpp
bitcoin-wallet-res.rc
bitcoin-wallet.cpp
bitcoind-res.rc
bitcoind.cpp
blockencodings.cpp
blockencodings.h
blockfilter.cpp
blockfilter.h
bloom.cpp
bloom.h
chain.cpp
chain.h
chainparams.cpp
chainparams.h
chainparamsbase.cpp
chainparamsbase.h
chainparamsseeds.h
checkqueue.h
clientversion.cpp
clientversion.h
coins.cpp
coins.h
compat.h
compressor.cpp
compressor.h
core_io.h
core_memusage.h
core_read.cpp
core_write.cpp
cuckoocache.h
dbwrapper.cpp
dbwrapper.h
dummywallet.cpp
flatfile.cpp
flatfile.h
fs.cpp
fs.h
hash.cpp
hash.h
httprpc.cpp
httprpc.h
httpserver.cpp
httpserver.h
indirectmap.h
init.cpp Merge #18289: refactor: Make scheduler methods type safe 2020-03-17 16:34:53 -04:00
init.h
key.cpp
key.h
key_io.cpp
key_io.h
limitedmap.h
logging.cpp
logging.h
memusage.h
merkleblock.cpp
merkleblock.h
miner.cpp
miner.h
net.cpp scheduler: Make schedule* methods type safe 2020-03-10 09:47:32 -04:00
net.h
net_permissions.cpp
net_permissions.h
net_processing.cpp net: fix use-after-free in tests 2020-03-18 13:03:26 +01:00
net_processing.h refactor: Remove mempool global from net 2020-03-12 09:23:56 -04:00
net_types.h
netaddress.cpp
netaddress.h
netbase.cpp
netbase.h
netmessagemaker.h
noui.cpp
noui.h
optional.h
outputtype.cpp
outputtype.h
pow.cpp
pow.h
prevector.h
protocol.cpp
protocol.h
psbt.cpp
psbt.h
pubkey.cpp
pubkey.h
random.cpp doc: fix GetTimeMicros() comment in random.cpp 2020-03-17 13:09:52 +08:00
random.h
randomenv.cpp
randomenv.h
rest.cpp
reverse_iterator.h
scheduler.cpp scheduler: Make schedule* methods type safe 2020-03-10 09:47:32 -04:00
scheduler.h scheduler: Make schedule* methods type safe 2020-03-10 09:47:32 -04:00
serialize.h
shutdown.cpp
shutdown.h
span.h
streams.h
sync.cpp
sync.h Fix missing header in sync.h 2020-03-15 22:43:39 +00:00
threadinterrupt.cpp
threadinterrupt.h
threadsafety.h
timedata.cpp
timedata.h
tinyformat.h
torcontrol.cpp
torcontrol.h
txdb.cpp
txdb.h
txmempool.cpp
txmempool.h
ui_interface.cpp
ui_interface.h
uint256.cpp
uint256.h
undo.h
validation.cpp Merge #15283: log: Fix UB with bench on genesis block 2020-03-17 14:27:42 -04:00
validation.h
validationinterface.cpp
validationinterface.h
version.h
versionbits.cpp
versionbits.h
versionbitsinfo.cpp
versionbitsinfo.h
walletinitinterface.h
warnings.cpp
warnings.h