Repository navigation
pbr-1.2.4: stop a mistyped address breaking or widening a policy - #209
Merged
Merged
Conversation
is_ipv4() allowed a leading zero, which nft reads as octal. So 09 or 08 in an octet or prefix passed validation, nft refused the generated file, and one such policy gave "FAILED TO START" with every policy lost. Refuse leading zeros in is_ipv4(). That alone would make things worse, for two reasons, so two more changes go with it: - is_domain() accepted whatever is_ipv4() refused, so a mistyped address became a domain set that dnsmasq can never fill. Four numbers are no longer a domain. - policy_process() reported an unknown entry but still wrote the rule, with that side left empty. With no address on a side the rule matches every address, so `src_addr 1.2.3.4/33` already sent all traffic down the policy's interface. A side that was configured but kept no usable entry now skips the policy. A side with one good entry keeps it. dns_policy_process() reported nothing for a bad entry, so it now reports errorPolicyProcessUnknownEntry too. The message already exists, so no compat bump is needed. A leading zero of 00 to 07 used to load, with the same value. Such an address is now reported and its policy is skipped. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Erik Conijn <egc112@msn.com>
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.
is_ipv4() allowed a leading zero, which nft reads as octal. So 09 or 08 in an octet or prefix passed validation, nft refused the generated file, and one such policy gave "FAILED TO START" with every policy lost.
Refuse leading zeros in is_ipv4(). That alone would make things worse, for two reasons, so two more changes go with it:
is_domain() accepted whatever is_ipv4() refused, so a mistyped address became a domain set that dnsmasq can never fill. Four numbers are no longer a domain.
policy_process() reported an unknown entry but still wrote the rule, with that side left empty. With no address on a side the rule matches every address, so
src_addr 1.2.3.4/33already sent all traffic down the policy's interface. A side that was configured but kept no usable entry now skips the policy. A side with one good entry keeps it.dns_policy_process() reported nothing for a bad entry, so it now reports errorPolicyProcessUnknownEntry too. The message already exists, so no compat bump is needed.
A leading zero of 00 to 07 used to load, with the same value. Such an address is now reported and its policy is skipped.
Assisted-by: Claude:claude-opus-5-5