Skip to content

rtnl module fixes#418

Merged
jow- merged 3 commits into
jow-:masterfrom
nbd168:rtnl-fixes
Jul 9, 2026
Merged

rtnl module fixes#418
jow- merged 3 commits into
jow-:masterfrom
nbd168:rtnl-fixes

Conversation

@nbd168

@nbd168 nbd168 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Fixes two stack overflows and a parse logic error.

nbd168 added 3 commits July 8, 2026 22:42
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>
@jow- jow- merged commit b885dd0 into jow-:master Jul 9, 2026
2 checks passed
@jow-

jow- commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Merged - thanks!

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