Repository navigation
Conversation
When receiving a prefix with size /56, networkd can assing 256 /64 prefixes from that. That value causes the uint8 "n_prefixes" to overflow. Though an extreme example, there could be someone using Prefix Delegation with a /18 from ULA space, which would even overflow an uint32, so uint64 would be the safe choice.
Contributor
Author
|
Seems like I only tested with uint32, not uint64, which broke the printfs. Sorry about that. |
Contributor
Author
|
OK, seems like this fix is not nearly as trivial as i thought. As I have absolutely no experience with real programming I don't feel capable of increasing the integer size while maintaining portability, so I'm closing this, instead adding my thoughts to #9591. Sorry for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When receiving a prefix with size /56, networkd can assign 256 /64 prefixes from that. That value causes the uint8 "n_prefixes" to overflow. Though an extreme example, there could be someone using Prefix Delegation with a /18 from ULA space, which would even overflow an uint32, so uint64 would be the safe choice.
This was also reported in #9591, but I've changed uint32 to uint64 because of the above reasoning.
There are possibly more bugs in the PD code, such as improperly calculating the next prefix and errors when blackholing the unused prefixes, but they require more research and should probably be separate issues/MRs.