Page MenuHomeFreeBSD

netinet6: free in6_ifextra with epoch_call(9)
Needs ReviewPublic

Authored by glebius on Thu, Jan 15, 3:25 AM.
Tags
None
Referenced Files
F142172230: D54728.diff
Fri, Jan 16, 6:56 PM
Unknown Object (File)
Thu, Jan 15, 5:18 PM
Unknown Object (File)
Thu, Jan 15, 5:15 PM
Unknown Object (File)
Thu, Jan 15, 4:55 PM
Unknown Object (File)
Thu, Jan 15, 9:19 AM
Unknown Object (File)
Thu, Jan 15, 8:35 AM
Unknown Object (File)
Thu, Jan 15, 8:28 AM
Unknown Object (File)
Thu, Jan 15, 7:56 AM

Details

Reviewers
jhibbits
Group Reviewers
network
transport
Summary

This is expected to fix the old in6_selecthlim() panics. The nature of
the panic is that a packet sending thread will obtain the struct ifnet
pointer locklessly and then pick the if_inet6 pointer from it and
dereference it. While the struct ifnet is freed via epoch_call(9), the
struct in6_ifextra until this change was not. For the forwarded packets,
or locally originated non-TCP packets we were probably safe due to the old
if_dead trick. But locally originated TCP packets may dereference
in6_ifextra via direct call into in6_selecthlim() from the tcp_output(),
before ip6_output().

NB: hypothetically a similar problem also applies to IPv4's if_inet pointer,
but there are no known panics, yet.

PR: 279653

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69903
Build 66786: arc lint + arc unit