Bug 253958 - wg: ifconfig wgN destroy panic
Summary: wg: ifconfig wgN destroy panic
Status: Closed DUPLICATE of bug 253583
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Keywords: iflib
Depends on:
Reported: 2021-03-02 15:57 UTC by nyan
Modified: 2021-03-02 18:19 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description nyan 2021-03-02 15:57:34 UTC
ifconfig wgN destroy caused the kernel panic at wg_detach.
After some investigation it seems wg_detach get called twice.
Comment 1 nyan 2021-03-02 15:58:27 UTC
root@wgbsd-aws-west-1:~ # ifconfig wg0 destroy
panic: Assertion mtx_unowned(m) failed at /usr/src/sys/kern/kern_mutex.c:1181
cpuid = 0
time = 1614728993
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe00793396e0
vpanic() at vpanic+0x181/frame 0xfffffe0079339730
panic() at panic+0x43/frame 0xfffffe0079339790
_mtx_destroy() at _mtx_destroy+0x4c/frame 0xfffffe00793397b0
wg_detach() at wg_detach+0xa9/frame 0xfffffe00793397e0
iflib_pseudo_deregister() at iflib_pseudo_deregister+0xfe/frame 0xfffffe0079339810
if_clone_destroyif() at if_clone_destroyif+0x237/frame 0xfffffe0079339860
if_clone_destroy() at if_clone_destroy+0x1f1/frame 0xfffffe00793398b0
ifioctl() at ifioctl+0x685/frame 0xfffffe0079339980
kern_ioctl() at kern_ioctl+0x289/frame 0xfffffe00793399f0
sys_ioctl() at sys_ioctl+0x12a/frame 0xfffffe0079339ac0
amd64_syscall() at amd64_syscall+0x12e/frame 0xfffffe0079339bf0
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0079339bf0
--- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x8004288ca, rsp = 0x7fffffffd238, rbp = 0x7fffffffd250 ---
KDB: enter: panic
[ thread pid 39045 tid 100080 ]
Stopped at      kdb_enter+0x37: movq    $0,0x128e40e(%rip)
Comment 2 Mark Johnston freebsd_committer 2021-03-02 16:03:11 UTC
Which rev?  See PR 253583.
Comment 3 nyan 2021-03-02 16:12:22 UTC
# uname -a
FreeBSD wg 14.0-CURRENT FreeBSD 14.0-CURRENT #0 main-n244733-c511a5ab53b: Thu Feb 11 07:07:14 UTC 2021

Will try again with a more recent current!
Comment 4 nyan 2021-03-02 18:13:29 UTC
(In reply to Mark Johnston from comment #2)
 Confirmed with a more recent current (ee21ee1572d40a3b74f18638dae38c1a9ad1e9e3) this issue is gone.
Comment 5 Mark Johnston freebsd_committer 2021-03-02 18:19:05 UTC
(In reply to nyan from comment #4)

*** This bug has been marked as a duplicate of bug 253583 ***