0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00
bitcoin-core/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 Import crc32c using subtree merge as as 'src/crc32c' 2020-01-28 17:00:01 +01:00
crypto
index make BlockUntilSyncedToCurrentChain() const 2020-03-02 17:26:30 +09:00
interfaces Replace GetSigningProvider with GetSolvingProvider 2020-03-09 11:16:20 -04:00
leveldb
logging doc: Correct spelling errors in comments 2020-03-02 23:07:21 -08:00
node doc: Correct spelling errors in comments 2020-03-02 23:07:21 -08:00
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 Update univalue subtree 2020-02-09 07:44:29 -08:00
util Move direct calls to MessageSign into new SignMessage functions in CWallet and ScriptPubKeyMan 2020-03-09 11:16:20 -04:00
wallet Merge #18289: refactor: Make scheduler methods type safe 2020-03-17 16:34:53 -04:00
zmq rpc: Auto-format RPCResult 2020-02-25 22:35:58 +07:00
.clang-format
addrdb.cpp
addrdb.h
addrman.cpp logging: asmap logging and #include fixups 2020-03-04 14:24:19 +01:00
addrman.h logging: asmap logging and #include fixups 2020-03-04 14:24:19 +01:00
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 scripted-diff: Replace MilliSleep with UninterruptibleSleep 2020-02-21 10:06:21 -08:00
bitcoin-tx-res.rc
bitcoin-tx.cpp
bitcoin-wallet-res.rc
bitcoin-wallet.cpp
bitcoind-res.rc
bitcoind.cpp scripted-diff: Replace MilliSleep with UninterruptibleSleep 2020-02-21 10:06:21 -08:00
blockencodings.cpp
blockencodings.h Convert blockencodings.h to new serialization framework 2020-02-25 14:10:44 -08:00
blockfilter.cpp
blockfilter.h
bloom.cpp
bloom.h
chain.cpp
chain.h Get rid of VARINT default argument 2020-02-10 12:00:10 -08:00
chainparams.cpp [test] add chainparams property to indicate chain allows time mocking 2020-02-13 08:59:51 -08:00
chainparams.h [test] add chainparams property to indicate chain allows time mocking 2020-02-13 08:59:51 -08:00
chainparamsbase.cpp
chainparamsbase.h
chainparamsseeds.h
checkqueue.h
clientversion.cpp
clientversion.h
coins.cpp
coins.h
compat.h
compressor.cpp
compressor.h Merge #17917: tests: Add amount compression/decompression fuzzing to existing fuzzing harness 2020-03-05 15:25:36 -05:00
core_io.h
core_memusage.h
core_read.cpp
core_write.cpp
cuckoocache.h
dbwrapper.cpp
dbwrapper.h
dummywallet.cpp
flatfile.cpp
flatfile.h Get rid of VARINT default argument 2020-02-10 12:00:10 -08:00
fs.cpp
fs.h
hash.cpp
hash.h
httprpc.cpp scripted-diff: Replace MilliSleep with UninterruptibleSleep 2020-02-21 10:06:21 -08:00
httprpc.h
httpserver.cpp httpserver: use own HTTP status codes 2020-02-18 08:29:35 +01:00
httpserver.h
indirectmap.h Add missing includes 2020-01-31 12:36:13 +00:00
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
Makefile.am Move FillPSBT to be a member of CWallet 2020-03-09 11:16:17 -04:00
Makefile.bench.include
Makefile.crc32c.include build: CRC32C build system integration 2020-01-28 17:01:48 +01:00
Makefile.leveldb.include build: CRC32C build system integration 2020-01-28 17:01:48 +01:00
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
memusage.h Add missing includes 2020-01-31 12:36:13 +00:00
merkleblock.cpp
merkleblock.h
miner.cpp Refactor FormatStateMessage into ValidationState 2020-02-27 17:59:07 -08:00
miner.h
net.cpp scheduler: Make schedule* methods type safe 2020-03-10 09:47:32 -04:00
net.h refactor: Convert ping wait time from double to int64_t 2020-03-04 13:45:29 -05:00
net_permissions.cpp
net_permissions.h net: Remove forcerelay of rejected txs 2020-02-11 07:44:12 -08:00
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 net: extract conditional to bool CNetAddr::IsHeNet 2020-03-04 14:31:31 +01:00
netaddress.h net: extract conditional to bool CNetAddr::IsHeNet 2020-03-04 14:31:31 +01:00
netbase.cpp
netbase.h
netmessagemaker.h
noui.cpp
noui.h
optional.h
outputtype.cpp Revert "Store p2sh scripts in AddAndGetDestinationForScript" 2020-02-12 11:48:30 -05:00
outputtype.h
pow.cpp
pow.h
prevector.h Make VectorFormatter support stateful formatters 2020-02-15 19:49:24 -08:00
protocol.cpp
protocol.h
psbt.cpp Merge #17156: psbt: check that various indexes and amounts are within bounds 2020-01-29 19:39:50 +08:00
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 Drop unused mach time headers 2020-02-28 14:56:49 -08:00
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 Merge #18112: Serialization improvements step 5 (blockencodings) 2020-03-05 19:56:26 +01:00
shutdown.cpp
shutdown.h
span.h
streams.h
sync.cpp sync.h: add REVERSE_LOCK 2020-03-06 23:13:31 +10:00
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 Get rid of VARINT default argument 2020-02-10 12:00:10 -08:00
txdb.h
txmempool.cpp
txmempool.h doc: Correct spelling errors in comments 2020-03-02 23:07:21 -08:00
ui_interface.cpp
ui_interface.h
uint256.cpp
uint256.h
undo.h Convert undo.h to new serialization framework 2020-02-06 19:08:11 -08:00
validation.cpp Merge #15283: log: Fix UB with bench on genesis block 2020-03-17 14:27:42 -04:00
validation.h
validationinterface.cpp Refactor FormatStateMessage into ValidationState 2020-02-27 17:59:07 -08:00
validationinterface.h
version.h
versionbits.cpp
versionbits.h
versionbitsinfo.cpp
versionbitsinfo.h
walletinitinterface.h
warnings.cpp
warnings.h