NetBSD-Bugs archive

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

Re: kern/48098: panic: kernel diagnostic assertion



The following reply was made to PR kern/48098; it has been noted by GNATS.

From: "S.P.Zeidler" <spz%NetBSD.org@localhost>
To: Brian Marcotte <marcotte%panix.com@localhost>
Cc: gnats-bugs%gnats.NetBSD.org@localhost
Subject: Re: kern/48098: panic: kernel diagnostic assertion
Date: Sun, 27 Oct 2013 18:00:18 +0000

 --fUYQa+Pmc3FrFX/N
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hello Brian,
 
 could you please test if the attached patch (kudos 
mlelstv%NetBSD.org@localhost)
 helps with the tcpdrop issue? it's only lightly tested so maybe not
 on your most precious server. :)
 
 For the reason there are stuck connections in the first place:
 when you have some, could you please check if an apache thread is
 stuck either in soaccept or kauth_cred_dup, from do_sys_accept?
 
 regards,
        spz
 
 --fUYQa+Pmc3FrFX/N
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="48098.patch-candidate"
 
 Index: sys/netinet/tcp_usrreq.c
 ===================================================================
 RCS file: /cvsroot/src/sys/netinet/tcp_usrreq.c,v
 retrieving revision 1.168
 diff -u -r1.168 tcp_usrreq.c
 --- sys/netinet/tcp_usrreq.c   4 Oct 2013 16:20:35 -0000       1.168
 +++ sys/netinet/tcp_usrreq.c   27 Oct 2013 17:36:13 -0000
 @@ -1199,12 +1199,16 @@
                struct tcpcb *tp;
                int error;
                
 -              if (inp == NULL || (tp = intotcpcb(inp)) == NULL ||
 -                  (inp->inp_socket->so_options & SO_ACCEPTCONN) != 0)
 +              solock(sockp);
 +              if ((tp = intotcpcb(inp)) == NULL ||
 +                  (sockp->so_options & SO_ACCEPTCONN) != 0) {
 +                      sounlock(sockp);
                        return ESRCH;
 +              }
  
                error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_SOCKET,
 -                  KAUTH_REQ_NETWORK_SOCKET_DROP, inp->inp_socket, tp, NULL);
 +                  KAUTH_REQ_NETWORK_SOCKET_DROP, sockp, tp, NULL);
 +              sounlock(sockp);
                if (error)
                        return (error);
                
 @@ -1234,12 +1238,16 @@
                struct tcpcb *tp;
                int error;
                
 -              if (in6p == NULL || (tp = in6totcpcb(in6p)) == NULL ||
 -                  (in6p->in6p_socket->so_options & SO_ACCEPTCONN) != 0)
 +              solock(sockp);
 +              if ((tp = in6totcpcb(in6p)) == NULL ||
 +                  (sockp->so_options & SO_ACCEPTCONN) != 0) {
 +                      sounlock(sockp);
                        return ESRCH;
 +              }
  
                error = kauth_authorize_network(l->l_cred, KAUTH_NETWORK_SOCKET,
 -                  KAUTH_REQ_NETWORK_SOCKET_DROP, in6p->in6p_socket, tp, NULL);
 +                  KAUTH_REQ_NETWORK_SOCKET_DROP, sockp, tp, NULL);
 +              sounlock(sockp);
                if (error)
                        return (error);
  
 
 --fUYQa+Pmc3FrFX/N--
 


Home | Main Index | Thread Index | Old Index