Page MenuHomeFreeBSD

in6_joingroup_locked: need if_addr_lock around in6m_disconnect_locked
Needs ReviewPublic

Authored by rlibby on Jun 24 2019, 4:27 PM.

Details

Reviewers
glebius
Summary

It looks like the call that requires the lock was introduced in r337866.

Sponsored by: Dell EMC Isilon

Test Plan

sysctl debug.fail_point.mnowait="1%return"
kyua test -k /usr/tests/sys/Kyuafile

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 25002
Build 23717: arc lint + arc unit

Event Timeline

rlibby created this revision.Jun 24 2019, 4:27 PM
rlibby added a subscriber: hselasky.Jul 1 2019, 4:08 PM

Patch looks good to me. Did you run this patch, I.E. force the error case somehow?

rlibby added a comment.Jul 2 2019, 2:50 PM

Patch looks good to me. Did you run this patch, I.E. force the error case somehow?

General background is that this patch and others are fallout from applying the error injection in D20714 (in this case, injecting errors for M_NOWAIT allocs of mbufs). They have mostly been tested with "it used to panic and now it doesn't," but I will see if I can confirm having tickled the specific error paths with dtrace.

rlibby added a comment.Jul 2 2019, 4:20 PM

Patch looks good to me. Did you run this patch, I.E. force the error case somehow?

General background is that this patch and others are fallout from applying the error injection in D20714 (in this case, injecting errors for M_NOWAIT allocs of mbufs). They have mostly been tested with "it used to panic and now it doesn't," but I will see if I can confirm having tickled the specific error paths with dtrace.

Here's this one. It really just demonstrates that the code path is executed and then we don't panic. I'm still working on demonstrating D20740.

# dtrace \
-n 'fbt::in6_joingroup_locked:entry {self->arm6=1}' \
-n 'fbt::mld_change_state:return /self->arm6 == 1 && args[1] != 0/ {self->arm6=2;}' \
-n 'fbt::in6m_disconnect_locked:entry /self->arm6 == 2/ {stack();}' \
-n 'fbt::in6_joingroup_locked:return {self->arm6=0}'
[...]
CPU     ID                    FUNCTION:NAME
  5  54752     in6m_disconnect_locked:entry 
              kernel`in6_joingroup_locked+0x552
              kernel`in6_joingroup+0x44
              kernel`in6_update_ifa+0x1882
              kernel`in6_ifattach+0x558
              kernel`in6_if_up+0x80
              kernel`if_up+0x6a
              kernel`ifhwioctl+0xc77
              kernel`ifioctl+0x529
              kernel`kern_ioctl+0x28a
              kernel`sys_ioctl+0x15d
              kernel`amd64_syscall+0x276
              kernel`0xffffffff8104542d
# kyua test -k /usr/tests/sys/netpfil/Kyuafile