Page MenuHomeFreeBSD

System crash on docker plugging out .
AbandonedPublic

Authored by steven_chen3_dell.com on Nov 20 2023, 10:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 27, 2:39 AM
Unknown Object (File)
Wed, Dec 17, 10:27 PM
Unknown Object (File)
Nov 7 2025, 5:20 AM
Unknown Object (File)
Nov 5 2025, 11:17 PM
Unknown Object (File)
Nov 5 2025, 9:21 PM
Unknown Object (File)
Nov 5 2025, 6:44 PM
Unknown Object (File)
Nov 5 2025, 6:26 PM
Unknown Object (File)
Nov 5 2025, 4:57 PM
Subscribers

Details

Reviewers
melifaro
Summary

if_purgeaddrs and in6_ifdetach are called by if_detach_internal, and both function can trigger ipv6 ia(interface address structure data) to be freed.
When interface is detached, this function is called, the calling statck is:
if_purgeaddrs -> in6_purgeifaddr -> in6_purgeifaddr
So ia is removed.
After that, in6_ifdetach is called, which call to in6_unlink_ifa( in6_ifdetach -> _in6_ifdetach ->
in6_unlink_ifa).
In in6_unlink_ifa, ifa_free is called directly without condition, so node of ia is duplicated free.
So, we add a new remove macro which can return find result.
the second change code is, remove the ifa_ref/ifa_free calling when use EVENTHANDLE_INVOKE in in6_notify_ifa,
because it is unnecessary.

Test Plan

Plug in/out the docker of supporting network.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

There should be a strong reference model around ifa. In in6_unlink_ifa() and ifa is expected to be linked into both lists, thus unlinked from both and two references removed. Looks like you have find a scenario when on entry in6_unlink_ifa() isn't linked at least into one list. Can you provide please reproduce recipe for the problem?

Hi glebius,
I made a mistake. There was a bug with the code we added ourselves. After I fixed it, the issue cannot reproduce now.
FreeBSD codes are no problem, because every time before in6_purgeaddr is called, the CK_STAILQ_FOREACH_SAFE has run.
I'm abandoning it now.