Skip to content

ospfd: Solved crash in OSPF TE parsing - #15431

Merged
ton31337 merged 1 commit into
FRRouting:masterfrom
Orange-OpenSource:ospf-te
Feb 27, 2024
Merged

ospfd: Solved crash in OSPF TE parsing#15431
ton31337 merged 1 commit into
FRRouting:masterfrom
Orange-OpenSource:ospf-te

Conversation

@odd22

@odd22 odd22 commented Feb 26, 2024

Copy link
Copy Markdown
Member

Iggy Frankovic discovered an ospfd crash when perfomring fuzzing of OSPF LSA packets. The crash occurs in ospf_te_parse_te() function when attemping to create corresponding egde from TE Link parameters. If there is no local address, an edge is created but without any attributes. During parsing, the function try to access to this attribute fields which has not been created causing an ospfd crash.

The patch simply check if the te parser has found a valid local address. If not found, we stop the parser which avoid the crash.

@frrbot frrbot Bot added the ospf label Feb 26, 2024
@ton31337 ton31337 added this to the 10.0 milestone Feb 27, 2024
@ton31337

Copy link
Copy Markdown
Member

@Mergifyio backport dev/10.0 stable/9.1 stable/9.0

@mergify

mergify Bot commented Feb 27, 2024

Copy link
Copy Markdown

backport dev/10.0 stable/9.1 stable/9.0

✅ Backports have been created

Details

Comment thread ospfd/ospf_te.c
ote_debug(" |- Found no valid TE Link local address. Abort!");
return -1;
}
edge = get_edge(ted, attr.adv, attr.standard.local);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we validate the "edge" instead of the above added check?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. In fact, the edge structure is correctly created. But, the unique identifier of the edge in the TED is based on the local address. Thus, if the local address is IPV4_NET0 (i.e. 0.0.0.0) we cannot correctly reference the edge in the TED. However, local ID is also a valid identifier. So, I need to check that both local address and local ID have not been found during TE parsing. I'll update the PR accordingly.

Iggy Frankovic discovered an ospfd crash when perfomring fuzzing of OSPF LSA
packets. The crash occurs in ospf_te_parse_te() function when attemping to
create corresponding egde from TE Link parameters. If there is no local
address, an edge is created but without any attributes. During parsing, the
function try to access to this attribute fields which has not been created
causing an ospfd crash.

The patch simply check if the te parser has found a valid local address. If not
found, we stop the parser which avoid the crash.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
@ton31337
ton31337 merged commit 541503e into FRRouting:master Feb 27, 2024
riw777 added a commit that referenced this pull request Feb 27, 2024
ospfd: Solved crash in OSPF TE parsing (backport #15431)
riw777 added a commit that referenced this pull request Feb 27, 2024
ospfd: Solved crash in OSPF TE parsing (backport #15431)
riw777 added a commit that referenced this pull request Feb 27, 2024
ospfd: Solved crash in OSPF TE parsing (backport #15431)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants