Page MenuHomeFreeBSD

Fix panic induced by ndp -P
Needs ReviewPublic

Authored by rstone on Jun 17 2020, 6:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 29 2023, 2:51 AM
Unknown Object (File)
Dec 20 2023, 3:03 AM
Unknown Object (File)
Nov 16 2023, 2:15 AM
Unknown Object (File)
Nov 14 2023, 3:11 PM
Unknown Object (File)
Nov 5 2023, 10:18 AM
Unknown Object (File)
Nov 5 2023, 9:20 AM
Unknown Object (File)
Oct 13 2023, 2:09 PM
Unknown Object (File)
Oct 4 2023, 9:16 AM
Subscribers

Details

Reviewers
bz
markj
ae
melifaro
Group Reviewers
network
Summary

If ndp -P was run, the kernel attempted to free all NDP prefixes,
even those for statically assigned IPs. Instead track the number
of autoconf addresses associated with each prefix and only have
ndp -P flush prefixes exclusively associated with autoconf
addresses.

Submitted by: Sabiha Tamragouri
Sponsored by: Dell EMC Isilon
MFC after: 1 month

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31777
Build 29339: arc lint + arc unit

Event Timeline

We should update the ndp man page to clarify which prefixes are being freed.

nd6_prefix_del() should assert that the autoconf address count is zero.

sys/netinet6/nd6.c
1786

Style, the || should be on the previous line.

So we don't purge any addresses if a non-autoconf address belongs to the prefix, but isn't that kind of surprising behaviour? I thought the main purpose of ndp -P is to flush all autoconfigured addresses.

sys/netinet6/nd6.h
240

Call it ndpr_autoconf_addrcnt, to be more consistent with ndpr_addrcnt?

sys/netinet6/nd6_rtr.c
2384

The if-statement condition is always true here.

Any chance a test can be added to verify the desired behaviour? IT shouldn't be too hard, there are multiple examples of tests creating 2 vnet jails for the simular purposes in netinet6/.

sys/netinet6/nd6.c
1786

In the other places, ndpr_num_autoconf_addrs was incremented/decremented w/o holding any lock.

Maybe, doing per-prefix wlock on increment/decrement and checking the condition under wlock here as well could work.

Also, a very dumb question: how does it help preventing panic?

sys/netinet6/nd6_rtr.c
1352

Is this needed given M_ZERO above?