diff options
author | marcel <marcel@FreeBSD.org> | 1999-09-29 20:12:39 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-09-29 20:12:39 +0000 |
commit | a77102446a7ed62892f4629f29c32047c3d43b72 (patch) | |
tree | c9e408177fc280914b661060693cf41b5d30699e /sys | |
parent | d4e70391772e9b3fa25d96b93d50278ea1c125ef (diff) | |
download | FreeBSD-src-a77102446a7ed62892f4629f29c32047c3d43b72.zip FreeBSD-src-a77102446a7ed62892f4629f29c32047c3d43b72.tar.gz |
Careless use of struct proc *p caused major problems. 'p' is allowed to
be NULL in this function (nfs_sigintr). Reorder the statements and guard
them all with a single if (p != NULL).
reported, reviewed and tested by: jdp
Diffstat (limited to 'sys')
-rw-r--r-- | sys/nfs/nfs_socket.c | 12 | ||||
-rw-r--r-- | sys/nfsclient/nfs_socket.c | 12 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsock.c | 12 |
3 files changed, 24 insertions, 12 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index 9434fb9..f7204b5 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -1504,15 +1504,19 @@ nfs_sigintr(nmp, rep, p) { sigset_t tmpset; - tmpset = p->p_siglist; - SIGSETNAND(tmpset, p->p_sigmask); - SIGSETNAND(tmpset, p->p_sigignore); if (rep && (rep->r_flags & R_SOFTTERM)) return (EINTR); if (!(nmp->nm_flag & NFSMNT_INT)) return (0); - if (p && SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) + if (p == NULL) + return (0); + + tmpset = p->p_siglist; + SIGSETNAND(tmpset, p->p_sigmask); + SIGSETNAND(tmpset, p->p_sigignore); + if (SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) return (EINTR); + return (0); } diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index 9434fb9..f7204b5 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -1504,15 +1504,19 @@ nfs_sigintr(nmp, rep, p) { sigset_t tmpset; - tmpset = p->p_siglist; - SIGSETNAND(tmpset, p->p_sigmask); - SIGSETNAND(tmpset, p->p_sigignore); if (rep && (rep->r_flags & R_SOFTTERM)) return (EINTR); if (!(nmp->nm_flag & NFSMNT_INT)) return (0); - if (p && SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) + if (p == NULL) + return (0); + + tmpset = p->p_siglist; + SIGSETNAND(tmpset, p->p_sigmask); + SIGSETNAND(tmpset, p->p_sigignore); + if (SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) return (EINTR); + return (0); } diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index 9434fb9..f7204b5 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -1504,15 +1504,19 @@ nfs_sigintr(nmp, rep, p) { sigset_t tmpset; - tmpset = p->p_siglist; - SIGSETNAND(tmpset, p->p_sigmask); - SIGSETNAND(tmpset, p->p_sigignore); if (rep && (rep->r_flags & R_SOFTTERM)) return (EINTR); if (!(nmp->nm_flag & NFSMNT_INT)) return (0); - if (p && SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) + if (p == NULL) + return (0); + + tmpset = p->p_siglist; + SIGSETNAND(tmpset, p->p_sigmask); + SIGSETNAND(tmpset, p->p_sigignore); + if (SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) return (EINTR); + return (0); } |