tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: panic: "(ln->la_flags & LLE_VALID) != 0" failed



> Date: Sun, 19 Apr 2020 00:15:46 +0000
> From: Taylor R Campbell <campbell+netbsd-tech-net%mumble.net@localhost>
> 
> The attached patch changes llentries_unlink to acquire LLE_WLOCK
> before calling lltable_unlink_entry, and changes lltable_unlink_entry
> to assert that the LLE_WLOCK is held before modifying the lle in case
> there are other code paths I haven't found that need LLE_WLOCK but
> lack it.  Haven't tested it yet.

Evidently this doesn't work -- something already holds the LLE_*LOCK
in llentries_unlink:


#0  0xffffffff80222965 in cpu_reboot (howto=howto@entry=260,
    bootstr=bootstr@entry=0x0)
    at /home/riastradh/netbsd/9/src/sys/arch/amd64/amd64/machdep.c:728
#1  0xffffffff80985343 in vpanic (
    fmt=fmt@entry=0xffffffff811d2c78 "lock error: %s: %s,%zu: %s: lock %p cpu %d lwp %p", ap=ap@entry=0xffffa40255962568)
    at /home/riastradh/netbsd/9/src/sys/kern/subr_prf.c:336
#2  0xffffffff809853f4 in panic (
    fmt=fmt@entry=0xffffffff811d2c78 "lock error: %s: %s,%zu: %s: lock %p cpu %d lwp %p") at /home/riastradh/netbsd/9/src/sys/kern/subr_prf.c:255
#3  0xffffffff8097e816 in lockdebug_abort (
    func=func@entry=0xffffffff810843b0 <__func__.6488> "rw_vector_enter",
    line=line@entry=350, lock=lock@entry=0xffff8cdb44308540,
    ops=ops@entry=0xffffffff814612d0 <rwlock_lockops>,
    msg=msg@entry=0xffffffff811cf84f "locking against myself")
    at /home/riastradh/netbsd/9/src/sys/kern/subr_lockdebug.c:1047
#4  0xffffffff80959e2d in rw_abort (rw=rw@entry=0xffff8cdb44308540,
    msg=0xffffffff811cf84f "locking against myself", line=350,
    func=<synthetic pointer>)
    at /home/riastradh/netbsd/9/src/sys/kern/kern_rwlock.c:193
#5  0xffffffff8095a0ef in rw_vector_enter (rw=0xffff8cdb44308540, op=RW_WRITER)
    at /home/riastradh/netbsd/9/src/sys/kern/kern_rwlock.c:350
#6  0xffffffff80a1de17 in llentries_unlink (
    llt=<optimized out>)
    at /home/riastradh/netbsd/9/src/sys/net/if_llatbl.c:309
#7  0xffffffff80a1deca in htable_prefix_free (llt=0xffff8cd47ecce108,
    prefix=<optimized out>, mask=<optimized out>, flags=<optimized out>)
    at /home/riastradh/netbsd/9/src/sys/net/if_llatbl.c:288
#8  0xffffffff80a1e67e in lltable_prefix_free (af=24,
    prefix=0xffffa402559627e8, mask=0xffff8cdb53ee432c, flags=0)
    at /home/riastradh/netbsd/9/src/sys/net/if_llatbl.c:521
#9  0xffffffff80a42fde in rtrequest1 (req=req@entry=2,
    info=info@entry=0xffffa402559628d0,
    ret_nrt=ret_nrt@entry=0xffffa402559628c8)
    at /home/riastradh/netbsd/9/src/sys/net/route.c:1221
#10 0xffffffff80a43861 in rtinit (ifa=ifa@entry=0xffff8cdb53ee4248,
    cmd=cmd@entry=2, flags=flags@entry=0)
    at /home/riastradh/netbsd/9/src/sys/net/route.c:1625
#11 0xffffffff80708ab6 in in6_ifremprefix (
    target=target@entry=0xffff8cdb53ee4248)
    at /home/riastradh/netbsd/9/src/sys/netinet6/in6.c:313
#12 0xffffffff80708cb3 in in6_ifremprefix (target=0xffff8cdb53ee4248)
    at /home/riastradh/netbsd/9/src/sys/netinet6/in6.c:1490
#13 in6_purgeaddr (ifa=0xffff8cdb53ee4248)
    at /home/riastradh/netbsd/9/src/sys/netinet6/in6.c:1428
#14 0xffffffff8070b5e3 in in6_control1 (ifp=0xffffa400469ca008,
    data=0xffff8cd790d34680, cmd=2166384921, so=0x81206919)
    at /home/riastradh/netbsd/9/src/sys/netinet6/in6.c:719
#15 in6_control (so=so@entry=0xffff8cdb52550728, cmd=cmd@entry=2166384921,
    data=data@entry=0xffff8cd790d34680, ifp=ifp@entry=0xffffa400469ca008)
    at /home/riastradh/netbsd/9/src/sys/netinet6/in6.c:772
#16 0xffffffff8072a0e6 in udp6_ioctl (ifp=0xffffa400469ca008,
    addr6=0xffff8cd790d34680, cmd=2166384921, so=0xffff8cdb52550728)
    at /home/riastradh/netbsd/9/src/sys/netinet6/udp6_usrreq.c:1210
#17 udp6_ioctl_wrapper (a=0xffff8cdb52550728, b=2166384921,
    c=0xffff8cd790d34680, d=0xffffa400469ca008)
    at /home/riastradh/netbsd/9/src/sys/netinet6/udp6_usrreq.c:1491
#18 0xffffffff806866a9 in compat_ifioctl (so=0xffff8cdb52550728,
    ocmd=2166384921, cmd=2166384921, data=0xffff8cd790d34680,
    l=<optimized out>)
    at /home/riastradh/netbsd/9/src/sys/compat/common/if_43.c:278
#19 0xffffffff80a0dbd3 in doifioctl (so=0xffff8cdb52550728,
    cmd=<optimized out>, data=0xffff8cd790d34680, l=0xffff8cdb52c1da20)
    at /home/riastradh/netbsd/9/src/sys/net/if.c:3394
#20 0xffffffff80990408 in sys_ioctl (l=<optimized out>,
    uap=0xffffa40255963000, retval=<optimized out>)
    at /home/riastradh/netbsd/9/src/sys/kern/sys_generic.c:671
#21 0xffffffff8024bb37 in sy_call (rval=0xffffa40255962fb0,
    uap=0xffffa40255963000, l=0xffff8cdb52c1da20,
    sy=0xffffffff8145c950 <sysent+1296>)
    at /home/riastradh/netbsd/9/src/sys/sys/syscallvar.h:65
#22 sy_invoke (code=54, rval=0xffffa40255962fb0, uap=0xffffa40255963000,
    l=0xffff8cdb52c1da20, sy=0xffffffff8145c950 <sysent+1296>)
    at /home/riastradh/netbsd/9/src/sys/sys/syscallvar.h:94
#23 syscall (frame=0xffffa40255963000)
    at /home/riastradh/netbsd/9/src/sys/arch/x86/x86/syscall.c:138
#24 0xffffffff802096dd in handle_syscall ()


Home | Main Index | Thread Index | Old Index