rtnl module fixes#418
Merged
Merged
Conversation
uc_nl_convert_rta_linkinfo() declared the attribute table as linkinfo_tb[IFLA_INFO_MAX] but passed IFLA_INFO_MAX as the maxtype to nla_parse(), which zero-initialises maxtype + 1 pointers and can store into index IFLA_INFO_MAX (IFLA_INFO_SLAVE_DATA), one past the end of the array. Size the table IFLA_INFO_MAX + 1 as the other attribute tables in this file do. Reachable by any RTM_GETLINK on an interface carrying IFLA_LINKINFO, such as a bridge, VLAN or veth. Signed-off-by: Felix Fietkau <nbd@nbd.name>
uc_nl_convert_rta_multipath() passed RTA_MAX + 1 as the maxtype to nla_parse() while the attribute table multipath_tb was sized RTA_MAX + 1. nla_parse() zero-initialises maxtype + 1 pointers, so it wrote one pointer past the end of the array. Pass RTA_MAX as the maxtype, matching the table size convention. Reachable by any RTM_GETROUTE result containing a multipath route. Signed-off-by: Felix Fietkau <nbd@nbd.name>
uc_nl_parse_rta_nexthop() treated a successful parse of the nexthop 'via' address as a failure: uc_nl_parse_cidr() returns true on success, but the code returned false in that case. Every attempt to add a route with a multipath nexthop therefore failed. Negate the check to match the other caller of uc_nl_parse_cidr() in this file. Signed-off-by: Felix Fietkau <nbd@nbd.name>
Owner
|
Merged - thanks! |
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.
Fixes two stack overflows and a parse logic error.