HomeFreeBSD

[multipath][nhops] Fix random crashes with high route churn rate.

Description

[multipath][nhops] Fix random crashes with high route churn rate.

When certain multipath route begins flapping really fast, it may
result in creating multiple identical nexthop groups. The code
responsible for unlinking unused nexthop groups had an implicit
assumption that there could be only one nexthop group for the
same combination of nexthops with weights. This assumption resulted
in always unlinking the first "identical" group, instead of the
desired one. Such action, in turn, produced a used-but-unlinked
nhg along with freed-and-linked nhg, ending up in random crashes.

Similarly, it is possible that multiple identical nexthops gets
created in the case of high route churn, resulting in the same
problem when deleting one of such nexthops.

Fix by matching the nexthop/nexhop group pointer when deleting the item.

Reported by: avg
MFC after: 1 week

Details

Provenance
melifaroAuthored on Aug 1 2021, 9:46 AM
Parents
rG60fb9e10c74c: cam: enable kern.cam.da.enable_uma_ccbs by default
Branches
Unknown
Tags
Unknown