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)
Sep 23 2024, 12:20 AM
Unknown Object (File)
Sep 20 2024, 7:29 AM
Unknown Object (File)
Sep 17 2024, 5:04 AM
Unknown Object (File)
Sep 16 2024, 9:09 PM
Unknown Object (File)
Sep 15 2024, 11:26 PM
Unknown Object (File)
Sep 15 2024, 4:02 PM
Unknown Object (File)
Sep 11 2024, 5:26 AM
Unknown Object (File)
Sep 1 2024, 10:19 PM
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.