summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_interface.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2021-07-09 03:58:02 -0400
committerChristian Hopps <chopps@labn.net>2021-07-09 04:15:34 -0400
commitff2052eefc7d99604c4480398c86163f2255ff73 (patch)
tree14d4b71898ecb7524acf7d2ce16d0345abfd84ef /ospf6d/ospf6_interface.c
parent3f8fcd2caa4fadeca9ecb8b432d28341d418cd2a (diff)
ospf6d: fix backlink check
This code has been wrong ~ever (according to git history). There are 3 conditional blocks with the added assertion that both the LSA and the vertex being checked can't both be network LSAs. The third block is clearly assuming both LSA and vertex are router LSAs b/c it is accessing the backlink and lsdesc as router lsdesc's also making sure both are p2p links (which they would have to be to point at each other). The programming error here is that (A && B) == False does NOT imply !A, but the code is written that way. So we end up in the third block one of LSA or vertex being network LSAs rather easily (whenever that is the case and the desc isn't the backlink being sought). This was caught by ASAN b/c the lsdesc and backlinks are being accessed (> 4 byte field offsets) as if they were router lsdesc's in the third block, when in fact one of them is a network lsdesc which is only 4 bytes long -- so ASAN flags the access beyond bounds. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'ospf6d/ospf6_interface.c')
0 files changed, 0 insertions, 0 deletions