Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2023 15:58:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 271101] cxgbe(4): panic due to lock recursion while creating tracing interface
Message-ID:  <bug-271101-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271101

            Bug ID: 271101
           Summary: cxgbe(4): panic due to lock recursion while creating
                    tracing interface
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: np@FreeBSD.org

cxgbe registers an ifnet cloner with the kernel so that a pseudo ifnet can =
be
created for use with tracing filters.  This code seems to panic after the
recent netlink changes.  These are the steps to reproduce (T6 or T5):

# ifconfig cc0 up
# ifconfig t6nex0 create

# ifconfig cxl0 up
# ifconfig t5nex0 create

The reason for the panic is that the new code calls the driver ioctl
(tracer_ioctl) during the creation of the interface (ether_ifattach).  This
pseudo-ifnet driver has always used the same lock in both routines.

#2  0xffffffff810e7a29 in vpanic (fmt=3D0xffffffff81b56047 "_sx_xlock_hard:
recursed on non-recursive sx %s @ %s:%d\n", ap=3D0xfffffe0094b2e3b0) at
/root/ws/t7/sys/kern/kern_shutdown.c:972
#3  0xffffffff810e726e in panic (fmt=3D0xffffffff81b56047 "_sx_xlock_hard:
recursed on non-recursive sx %s @ %s:%d\n") at
/root/ws/t7/sys/kern/kern_shutdown.c:896
#4  0xffffffff810f8b81 in _sx_xlock_hard (sx=3D0xffffffff833c9698
<t4_trace_lock>, x=3D18446735277694109504, opts=3D0, file=3D0xffffffff833a8=
09d
"/root/ws/t7/sys/dev/cxgbe/t4_tracer.c", line=3D487) at
/root/ws/t7/sys/kern/kern_sx.c:628
#5  0xffffffff810f884b in _sx_xlock (sx=3D0xffffffff833c9698 <t4_trace_lock=
>,
opts=3D0, file=3D0xffffffff833a809d "/root/ws/t7/sys/dev/cxgbe/t4_tracer.c",
line=3D487) at /root/ws/t7/sys/kern/kern_sx.c:332
#6  0xffffffff8338fde0 in tracer_ioctl (ifp=3D0xfffff80001935800, cmd=3D322=
4398136,
data=3D0xfffffe0094b2e698 "") at /root/ws/t7/sys/dev/cxgbe/t4_tracer.c:487
#7  0xffffffff814a20e7 in get_operstate_ether (ifp=3D0xfffff80001935800,
pstate=3D0xfffffe0094b2e728) at /root/ws/t7/sys/netlink/route/iface.c:125
#8  0xffffffff814a1a2b in get_operstate (ifp=3D0xfffff80001935800,
pstate=3D0xfffffe0094b2e728) at /root/ws/t7/sys/netlink/route/iface.c:182
#9  0xffffffff814a166d in dump_iface (nw=3D0xfffffe0094b2e770,
ifp=3D0xfffff80001935800, hdr=3D0xfffffe0094b2e7b0, if_flags_mask=3D0) at
/root/ws/t7/sys/netlink/route/iface.c:269
#10 0xffffffff814a0f5d in rtnl_handle_ifevent (ifp=3D0xfffff80001935800,
nlmsg_type=3D16, if_flags_mask=3D0) at /root/ws/t7/sys/netlink/route/iface.=
c:952
#11 0xffffffff814a1212 in rtnl_handle_ifattach (arg=3D0x0,
ifp=3D0xfffff80001935800) at /root/ws/t7/sys/netlink/route/iface.c:960
#12 0xffffffff812a6def in if_attach_internal (ifp=3D0xfffff80001935800,
vmove=3Dfalse) at /root/ws/t7/sys/net/if.c:958
#13 0xffffffff812a67b9 in if_attach (ifp=3D0xfffff80001935800) at
/root/ws/t7/sys/net/if.c:773
#14 0xffffffff812b9a0d in ether_ifattach (ifp=3D0xfffff80001935800,
lla=3D0xfffffe0094b2e908 "") at /root/ws/t7/sys/net/if_ethersubr.c:1002
#15 0xffffffff8338ef92 in t4_cloner_create (ifc=3D0xfffff800014a2600,
name=3D0xfffffe0094b2ea50 "t6nex0", len=3D16, params=3D0x0) at
/root/ws/t7/sys/dev/cxgbe/t4_tracer.c:196
#16 0xffffffff812b6f0a in ifc_advanced_create_wrapper (ifc=3D0xfffff800014a=
2600,
name=3D0xfffffe0094b2ea50 "t6nex0", maxlen=3D16, ifc_data=3D0xfffffe0094b2e=
aa0,
ifpp=3D0xfffffe0094b2ea20) at /root/ws/t7/sys/net/if_clone.c:468
#17 0xffffffff812b5894 in if_clone_createif (ifc=3D0xfffff800014a2600,
name=3D0xfffffe0094b2ea50 "t6nex0", len=3D16, ifd=3D0xfffffe0094b2eaa0,
ifpp=3D0xfffffe0094b2ea20) at /root/ws/t7/sys/net/if_clone.c:323
#18 0xffffffff812b56e7 in ifc_create_ifp (name=3D0xfffffe0094b2ed98 "t6nex0=
",
ifd=3D0xfffffe0094b2eaa0, ifpp=3D0xfffffe0094b2ea98) at
/root/ws/t7/sys/net/if_clone.c:205
#19 0xffffffff812b5983 in if_clone_create (name=3D0xfffffe0094b2ed98 "t6nex=
0",
len=3D16, params=3D0x0) at /root/ws/t7/sys/net/if_clone.c:218
#20 0xffffffff812ae6ae in ifioctl (so=3D0xfffff800040dc000, cmd=3D322334962=
8,
data=3D0xfffffe0094b2ed98 "t6nex0", td=3D0xfffff800049fc740) at
/root/ws/t7/sys/net/if.c:3100

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-271101-227>