Page MenuHomeFreeBSD

[Bug 211031] [panic] in ng_uncallout when argument is NULL
ClosedPublic

Authored by mizhka on Jul 13 2016, 11:17 PM.

Details

Summary

This patch allows to avoid panic from ng_uncallout with 11-ALPHA6 and 12-CURRENT when I unplug ethernet cable with active PPTP VPN connection.

db> bt
Tracing pid 902 tid 100675 td 0xfffff800169a1000
ng_uncallout() at ng_uncallout+0x3d/frame 0xfffffe04530b3580
ng_pptpgre_disconnect() at ng_pptpgre_disconnect+0xbb/frame 0xfffff*
ng_destroy_hook() at ng_destroy_hook+0xlfe/frame 8xfffffe84538b35d8
ng_ranode() at ng_ranode+0x75/frame 0xfffffe04538b3618
ng_apply_item() at ng_apply_itea+0x4ca/frame 0xfffffeB4538b36a8
ng_snd_item() at ng_snd_itea+0x3a9/frame 0xfffffeB4538b36e0
ngc_send() at ngc_send+0x21b/frame 0xfffffe04530b3790
sosend_generic() at sosend_generic+0x436/frame 0xfffffe04538b3850
kern_sendit() at kern_sendit+0x21b/frame Bxfffffe04538b390B
sendit() at sendit+0x19f/frame 0xfffffeB4530b3950
sys_sendto() at sys_sendto+0x4d/frame 0xfffffe04530b39a0
amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe04530b3ab0
Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffeB4530b3abB

  • syscall (133, FreeBSD ELF64, sys_sendto), rip = 0x80253906a, rsp - 0x7fffdfffd72B, rbp - 0x7fffdfffd770
Test Plan

Test case:

  • use wired ethernet connection
  • establish PPTP connection using mpd5
  • unplug ethernet cable (=> panic)

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mizhka updated this revision to Diff 18392.Jul 13 2016, 11:17 PM
mizhka retitled this revision from to [Bug 211031] [panic] in ng_uncallout when argument is NULL.
mizhka updated this object.
mizhka edited the test plan for this revision. (Show Details)
mizhka set the repository for this revision to rS FreeBSD src repository.
ngie added a subscriber: ngie.Jul 14 2016, 8:00 PM
ngie added inline comments.
sys/netgraph/ng_base.c
3817 ↗(On Diff #18392)

style(9): please use item != NULL instead

ngie accepted this revision.Jul 14 2016, 8:01 PM
ngie added a reviewer: ngie.
ngie added subscribers: bz, ae.

Seems ok to me, modulo the style nit. I've added ae@/bz@ for comment (they might not be the right folks from net@ though...).

This revision is now accepted and ready to land.Jul 14 2016, 8:02 PM
bz added a comment.Jul 14 2016, 11:47 PM

Is this sudden problem possibly related to glebius' callout changes? I am not properly tracking things but if invariants changed and weren't reflected in the callers, that might explain.

ngie added a comment.Jul 14 2016, 11:53 PM
In D7209#150056, @bz wrote:

Is this sudden problem possibly related to glebius' callout changes? I am not properly tracking things but if invariants changed and weren't reflected in the callers, that might explain.

I don't know to be honest.

I'll add glebius (I should have done that in the first place).

ngie edited edge metadata.Jul 14 2016, 11:53 PM
ngie added subscribers: glebius, network.

From my side this patch fixes issue with frequent crashes caused by reconnect of mpd5 pptp link ( 12.0-CURRENT r302535M amd64 ). Thank you

mizhka updated this revision to Diff 18482.Jul 16 2016, 8:45 AM
mizhka edited edge metadata.
  • style(9) change
  • no functional change

Tested, at least works for me

This revision now requires review to proceed.Jul 16 2016, 8:45 AM
mizhka marked an inline comment as done.Jul 16 2016, 8:46 AM

works fine to me too
12.0-CURRENT #26 r302424M

This revision was automatically updated to reflect the committed changes.
julian added a subscriber: julian.Aug 14 2016, 2:23 PM

This shoudn't be needed.. it should be panic condition if item is NULL.