Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport: fix uninitialized read when stringifying an addrLocal #26

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

fdoving
Copy link
Contributor

@fdoving fdoving commented Dec 14, 2021

Manual backport of bitcoin PR 14728

Reachable from either place where SetIP is used when our best-guess
addrLocal for a peer is IPv4, but the peer tells us it's reaching us at
an IPv6 address.

In that case, SetIP turns an IPv4 address into an IPv6 address without
setting the scopeId, which is subsequently read in GetSockAddr during
CNetAddr::ToStringIP and passed to getnameinfo. Fix by ensuring every
constructor initializes the scopeId field with something.

Manual backport of bitcoin PR 14728

Reachable from either place where SetIP is used when our best-guess
addrLocal for a peer is IPv4, but the peer tells us it's reaching us at
an IPv6 address.

In that case, SetIP turns an IPv4 address into an IPv6 address without
setting the scopeId, which is subsequently read in GetSockAddr during
CNetAddr::ToStringIP and passed to getnameinfo. Fix by ensuring every
constructor initializes the scopeId field with something.
@alamshafil
Copy link
Contributor

+1

@alamshafil alamshafil changed the base branch from master to dev December 14, 2021 21:46
@alamshafil alamshafil merged commit 97eaa1f into AvianNetwork:dev Dec 15, 2021
alamshafil pushed a commit that referenced this pull request Aug 22, 2022
Manual backport of bitcoin PR 14728

Reachable from either place where SetIP is used when our best-guess
addrLocal for a peer is IPv4, but the peer tells us it's reaching us at
an IPv6 address.

In that case, SetIP turns an IPv4 address into an IPv6 address without
setting the scopeId, which is subsequently read in GetSockAddr during
CNetAddr::ToStringIP and passed to getnameinfo. Fix by ensuring every
constructor initializes the scopeId field with something.

(cherry picked from commit 97eaa1f)
alamshafil added a commit that referenced this pull request Aug 22, 2022
cherry-pick: backport: fix uninitialized read when stringifying an addrLocal (#26)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants