On Tue, Sep 20, 2016 at 09:19 -0400, David Hill wrote:
> Another...
> 
> splassert: sorwakeup: want 5 have 4
> Starting stack trace...
> splassert_check() at splassert_check+0x78
> sorwakeup() at sorwakeup+0x27
> pfkey_sendup() at pfkey_sendup+0x99
> pfkeyv2_sendmessage() at pfkeyv2_sendmessage+0x226
> pfkeyv2_expire() at pfkeyv2_expire+0x18d
> tdb_timeout() at tdb_timeout+0x2f
> softclock() at softclock+0x144
> softintr_dispatch() at softintr_dispatch+0x8b
> Xsoftclock() at Xsoftclock+0x1f
> --- interrupt ---
> end of kernel
> end trace frame: 0x20, count: 248
> 0x8:
> End of stack trace.
> 

All TDB timeouts can do an splsoftnet.  OK?

Index: netinet/ip_ipsp.c
===================================================================
RCS file: /home/cvs/src/sys/netinet/ip_ipsp.c,v
retrieving revision 1.216
diff -u -p -r1.216 ip_ipsp.c
--- netinet/ip_ipsp.c   19 Sep 2016 18:09:22 -0000      1.216
+++ netinet/ip_ipsp.c   20 Sep 2016 13:34:16 -0000
@@ -504,55 +504,67 @@ void
 tdb_timeout(void *v)
 {
        struct tdb *tdb = v;
+       int s;
 
        if (!(tdb->tdb_flags & TDBF_TIMER))
                return;
 
+       s = splsoftnet();
        /* If it's an "invalid" TDB do a silent expiration. */
        if (!(tdb->tdb_flags & TDBF_INVALID))
                pfkeyv2_expire(tdb, SADB_EXT_LIFETIME_HARD);
        tdb_delete(tdb);
+       splx(s);
 }
 
 void
 tdb_firstuse(void *v)
 {
        struct tdb *tdb = v;
+       int s;
 
        if (!(tdb->tdb_flags & TDBF_SOFT_FIRSTUSE))
                return;
 
+       s = splsoftnet();
        /* If the TDB hasn't been used, don't renew it. */
        if (tdb->tdb_first_use != 0)
                pfkeyv2_expire(tdb, SADB_EXT_LIFETIME_HARD);
        tdb_delete(tdb);
+       splx(s);
 }
 
 void
 tdb_soft_timeout(void *v)
 {
        struct tdb *tdb = v;
+       int s;
 
        if (!(tdb->tdb_flags & TDBF_SOFT_TIMER))
                return;
 
+       s = splsoftnet();
        /* Soft expirations. */
        pfkeyv2_expire(tdb, SADB_EXT_LIFETIME_SOFT);
        tdb->tdb_flags &= ~TDBF_SOFT_TIMER;
+       splx(s);
 }
 
 void
 tdb_soft_firstuse(void *v)
 {
        struct tdb *tdb = v;
+       int s;
 
        if (!(tdb->tdb_flags & TDBF_SOFT_FIRSTUSE))
                return;
 
+       s = splsoftnet();
        /* If the TDB hasn't been used, don't renew it. */
        if (tdb->tdb_first_use != 0)
                pfkeyv2_expire(tdb, SADB_EXT_LIFETIME_SOFT);
        tdb->tdb_flags &= ~TDBF_SOFT_FIRSTUSE;
+       splx(s);
 }
 
 /*

Reply via email to