Page MenuHomeFreeBSD

Lock the ND prefix list and add refcounting for prefixes.
ClosedPublic

Authored by markj on Oct 2 2016, 8:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
May 24 2024, 9:18 PM
Unknown Object (File)
May 24 2024, 4:56 PM
Unknown Object (File)
May 23 2024, 5:06 AM
Unknown Object (File)
May 22 2024, 8:41 PM
Unknown Object (File)
May 22 2024, 5:18 PM
Unknown Object (File)
Apr 16 2024, 6:12 PM
Unknown Object (File)
Apr 16 2024, 6:11 PM
Unknown Object (File)
Apr 4 2024, 11:52 AM
Subscribers
None

Details

Summary

This change extends the nd6 lock to protect the NDP prefix list and the
list of advertising routers associated with each prefix. To handle cases
where the nd6 lock must be dropped while iterating over either the
prefix or default router lists, a generation counter is used to track
modifications to the lists. Additionally, a new mutex is used to serialize
prefix on-link and off-link transitions. This mutex must be
acquired before the ND6 lock and is held while updating the routing
table in nd6_prefix_onlink() and nd6_prefix_offlink().

As with default router objects, prefix expiry is split into two steps:
unlinking from the prefix list with the ND6 lock held, and then deletion.

Test Plan

This has been tested in production at Limelight for several months.
Without it, they regularly see panics caused by double frees and
use-after-frees of prefix objects.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj retitled this revision from to Lock the prefix list and add refcounting for prefixes..
markj edited the test plan for this revision. (Show Details)
markj updated this object.
markj retitled this revision from Lock the prefix list and add refcounting for prefixes. to Lock the ND prefix list and add refcounting for prefixes..Oct 2 2016, 8:10 PM
markj edited the test plan for this revision. (Show Details)
markj edited the test plan for this revision. (Show Details)
markj added reviewers: hrs, bz, ae, melifaro.

(I'm planning to commit this at the end of the week if no one has any objections.)

ae edited edge metadata.

Looks reasonable for me.

This revision is now accepted and ready to land.Oct 7 2016, 5:55 AM
tuexen edited edge metadata.

OK for the SCTP part of it.

This revision was automatically updated to reflect the committed changes.