diff options
author | Ava Chow <github@achow101.com> | 2024-09-20 12:55:22 -0400 |
---|---|---|
committer | Ava Chow <github@achow101.com> | 2024-09-20 12:55:22 -0400 |
commit | 0d81b3ddedc73daf934242885c60f05f812ac275 (patch) | |
tree | 146e5c0812a2877a65acbc567411f2cd1a04ba3f /src/wallet | |
parent | c985a34b9c3246888a4fc05519f1f025a5c62422 (diff) | |
parent | 51f7668d31e2624e41c7ce77fe33162802808f3f (diff) | |
download | bitcoin-0d81b3ddedc73daf934242885c60f05f812ac275.tar.xz |
Merge bitcoin/bitcoin#30568: addrman: change internal id counting to int64_t
51f7668d31e2624e41c7ce77fe33162802808f3f addrman: change nid_type from int to int64_t (Martin Zumsande)
051ba3290e30e210bfc50dea974063053313ad3e addrman, refactor: introduce user-defined type for internal nId (Martin Zumsande)
Pull request description:
With `nIdCount` being incremented for each addr received, an attacker could cause an overflow in the past, see https://bitcoincore.org/en/2024/07/31/disclose-addrman-int-overflow/
Even though that attack was made infeasible indirectly by addr rate-limiting (PR #22387), to be on the safe side and prevent any regressions change the `nId`s used internally to `int64_t`.
This is being done by first introducing a user-defined type for `nId`s in the first commit, and then updating it to `int64_t` (thanks sipa for help with this!).
Note that `nId` is only used internally, it is not part of the serialization, so `peers.dat` should not be affected by this.
I assume that the only reason this was not done in the past is to not draw attention to this previously undisclosed issue.
ACKs for top commit:
naumenkogs:
ACK 51f7668d31e2624e41c7ce77fe33162802808f3f
stratospher:
ACK 51f7668d31e2624e41c7ce77fe33162802808f3f. I think it's a good change to make the nId space large(64 bits) so that the nId values are distinct.
achow101:
ACK 51f7668d31e2624e41c7ce77fe33162802808f3f
Tree-SHA512: 68d4b8b0269a01a9544bedfa7c1348ffde00a288537e4c8bf2b88372ac7d96c4566a44dd6b06285f2fcf31b4f9336761e3bca7253fbc20db5e0d04e887156224
Diffstat (limited to 'src/wallet')
0 files changed, 0 insertions, 0 deletions