-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ospfd: Solved crash in OSPF TE parsing #15431
Conversation
@Mergifyio backport dev/10.0 stable/9.1 stable/9.0 |
✅ Backports have been created
|
if (IPV4_NET0(attr.standard.local.s_addr)) { | ||
ote_debug(" |- Found no valid TE Link local address. Abort!"); | ||
return -1; | ||
} | ||
edge = get_edge(ted, attr.adv, attr.standard.local); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 <[email protected]>
ospfd: Solved crash in OSPF TE parsing (backport #15431)
ospfd: Solved crash in OSPF TE parsing (backport #15431)
ospfd: Solved crash in OSPF TE parsing (backport #15431)
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.