]> git.puffer.fish Git - mirror/frr.git/commit
ospfd: Correct Opaque LSA Extended parser
authorOlivier Dugeon <olivier.dugeon@orange.com>
Fri, 5 Apr 2024 10:57:11 +0000 (12:57 +0200)
committerOlivier Dugeon <olivier.dugeon@orange.com>
Thu, 23 May 2024 08:46:10 +0000 (10:46 +0200)
commit5557a289acdaeec8cc63ffc97b5c2abf6dee7b3a
tree10f53935a7265403266b17182cda05d7169f5ce6
parentf69d1313b19047d3d83fc2b36a518355b861dfc4
ospfd: Correct Opaque LSA Extended parser

Iggy Frankovic discovered another ospfd crash when performing fuzzing of OSPF
LSA packets. The crash occurs in ospf_te_parse_ext_link() function when
attemping to read Segment Routing Adjacency SID subTLVs. The original code
doesn't check if the size of the Extended Link TLVs and subTLVs have the correct
length. In presence of erronous LSA, this will cause a buffer overflow and ospfd
crashes.

This patch introduces new verification of the subTLVs size for Extended Link
TLVs and subTLVs. Similar check has been also introduced for the Extended
Prefix TLV.

Co-authored-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
ospfd/ospf_te.c