Source-Changes-HG archive

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

[src/nathanw_sa]: src/sys Be more careful not to dereference curproc when the...



details:   https://anonhg.NetBSD.org/src/rev/a1979f6dd0c5
branches:  nathanw_sa
changeset: 504575:a1979f6dd0c5
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Tue Mar 13 20:29:48 2001 +0000

description:
Be more careful not to dereference curproc when there might not be
a process context.

diffstat:

 sys/netccitt/pk_acct.c    |  4 ++--
 sys/netccitt/pk_usrreq.c  |  4 ++--
 sys/netinet/ip_output.c   |  4 ++--
 sys/netinet6/in6_src.c    |  4 ++--
 sys/netinet6/ip6_input.c  |  4 ++--
 sys/netinet6/ip6_output.c |  6 +++---
 sys/netinet6/raw_ip6.c    |  4 ++--
 sys/netiso/tp_output.c    |  4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)

diffs (153 lines):

diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netccitt/pk_acct.c
--- a/sys/netccitt/pk_acct.c    Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netccitt/pk_acct.c    Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pk_acct.c,v 1.13.6.1 2001/03/05 22:49:55 nathanw Exp $ */
+/*     $NetBSD: pk_acct.c,v 1.13.6.2 2001/03/13 20:29:48 nathanw Exp $ */
 
 /*
  * Copyright (c) 1984 University of British Columbia.
@@ -70,7 +70,7 @@
        struct vnode *vp = NULL;
        struct nameidata nd;
        struct vnode *oacctp = pkacctp;
-       struct proc *p = curproc->l_proc;       /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
        int error;
 
        if (path == 0)
diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netccitt/pk_usrreq.c
--- a/sys/netccitt/pk_usrreq.c  Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netccitt/pk_usrreq.c  Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pk_usrreq.c,v 1.19.6.1 2001/03/05 22:49:56 nathanw Exp $       */
+/*     $NetBSD: pk_usrreq.c,v 1.19.6.2 2001/03/13 20:29:48 nathanw Exp $       */
 
 /*
  * Copyright (c) 1984 University of British Columbia.
@@ -437,7 +437,7 @@
        struct mbuf   **mp;
        int             cmd, level, optname;
 {
-       struct proc *p = curproc->l_proc;               /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
        struct mbuf *m = *mp;
        struct pklcd *lcp = (struct pklcd *) so->so_pcb;
        int             error = EOPNOTSUPP;
diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netinet/ip_output.c   Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_output.c,v 1.83.2.1 2001/03/05 22:49:56 nathanw Exp $       */
+/*     $NetBSD: ip_output.c,v 1.83.2.2 2001/03/13 20:29:49 nathanw Exp $       */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -858,7 +858,7 @@
        int error = 0;
 #ifdef IPSEC
 #ifdef __NetBSD__
-       struct proc *p = curproc->l_proc;       /*XXX*/
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /*XXX*/
 #endif
 #endif
 
diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netinet6/in6_src.c
--- a/sys/netinet6/in6_src.c    Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netinet6/in6_src.c    Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_src.c,v 1.5.2.1 2001/03/05 22:49:57 nathanw Exp $  */
+/*     $NetBSD: in6_src.c,v 1.5.2.2 2001/03/13 20:29:50 nathanw Exp $  */
 /*     $KAME: in6_src.c,v 1.36 2001/02/06 04:08:17 itojun Exp $        */
 
 /*
@@ -340,7 +340,7 @@
        int wild = 0;
        void *t;
        u_int16_t min, max;
-       struct proc *p = curproc->l_proc;               /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
 
        /* XXX: this is redundant when called from in6_pcbbind */
        if ((so->so_options & (SO_REUSEADDR|SO_REUSEPORT)) == 0 &&
diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netinet6/ip6_input.c
--- a/sys/netinet6/ip6_input.c  Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netinet6/ip6_input.c  Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_input.c,v 1.37.2.1 2001/03/05 22:49:57 nathanw Exp $       */
+/*     $NetBSD: ip6_input.c,v 1.37.2.2 2001/03/13 20:29:50 nathanw Exp $       */
 /*     $KAME: ip6_input.c,v 1.183 2001/03/01 15:15:23 itojun Exp $     */
 
 /*
@@ -979,7 +979,7 @@
        struct ip6_hdr *ip6;
        struct mbuf *m;
 {
-       struct proc *p = curproc->l_proc;       /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
        int privileged;
 
        privileged = 0;
diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netinet6/ip6_output.c
--- a/sys/netinet6/ip6_output.c Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netinet6/ip6_output.c Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_output.c,v 1.31.2.1 2001/03/05 22:49:57 nathanw Exp $      */
+/*     $NetBSD: ip6_output.c,v 1.31.2.2 2001/03/13 20:29:50 nathanw Exp $      */
 /*     $KAME: ip6_output.c,v 1.152 2001/02/02 15:36:33 jinmei Exp $    */
 
 /*
@@ -1239,7 +1239,7 @@
        struct mbuf *m = *mp;
        int optval = 0;
        int error = 0;
-       struct proc *p = curproc->l_proc;       /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
 
        if (level == IPPROTO_IPV6) {
                switch (op) {
@@ -1573,7 +1573,7 @@
 {
        struct ip6_pktopts *opt = *pktopt;
        int error = 0;
-       struct proc *p = curproc->l_proc;       /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
        int priv = 0;
 
        /* turn off any old options. */
diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netinet6/raw_ip6.c
--- a/sys/netinet6/raw_ip6.c    Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netinet6/raw_ip6.c    Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: raw_ip6.c,v 1.31.2.1 2001/03/05 22:49:58 nathanw Exp $ */
+/*     $NetBSD: raw_ip6.c,v 1.31.2.2 2001/03/13 20:29:51 nathanw Exp $ */
 /*     $KAME: raw_ip6.c,v 1.69 2001/03/04 15:55:44 itojun Exp $        */
 
 /*
@@ -391,7 +391,7 @@
 
        priv = 0;
     {
-       struct proc *p = curproc->l_proc;       /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
 
        if (p && !suser(p->p_ucred, &p->p_acflag))
                priv = 1;
diff -r 0f3e77f926b3 -r a1979f6dd0c5 sys/netiso/tp_output.c
--- a/sys/netiso/tp_output.c    Tue Mar 13 16:31:32 2001 +0000
+++ b/sys/netiso/tp_output.c    Tue Mar 13 20:29:48 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tp_output.c,v 1.19.6.1 2001/03/05 22:49:58 nathanw Exp $       */
+/*     $NetBSD: tp_output.c,v 1.19.6.2 2001/03/13 20:29:51 nathanw Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -395,7 +395,7 @@
        struct socket  *so;
        struct mbuf   **mp;
 {
-       struct proc *p = curproc->l_proc;               /* XXX */
+       struct proc *p = (curproc ? curproc->l_proc : 0);       /* XXX */
        struct tp_pcb  *tpcb = sototpcb(so);
        int             s = splsoftnet();
        caddr_t         value;



Home | Main Index | Thread Index | Old Index