summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2004-10-24 19:35:02 +0000
committermlaier <mlaier@FreeBSD.org>2004-10-24 19:35:02 +0000
commita18af33877fa2d0d101b28b41dc3e19f16cbde0c (patch)
tree57ae03d4d50e490e6eb7d43cc1b2ebad7e38134f /sys/contrib
parent0041f5bef40a72af5bca742616209ccb2ef3761b (diff)
downloadFreeBSD-src-a18af33877fa2d0d101b28b41dc3e19f16cbde0c.zip
FreeBSD-src-a18af33877fa2d0d101b28b41dc3e19f16cbde0c.tar.gz
Fix a panic discovered with some apache2 configure test (that seemed to
trigger a socket creation race some some kind). Checking for non-NULL socket and credential is not a bad idea anyway. Unfortunatly too late for the release. Reported & tested by: Gilbert Cao MFC after: 2 weeks
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/pf/net/pf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/contrib/pf/net/pf.c b/sys/contrib/pf/net/pf.c
index 2a5b627..861ddff 100644
--- a/sys/contrib/pf/net/pf.c
+++ b/sys/contrib/pf/net/pf.c
@@ -2506,6 +2506,11 @@ pf_socket_lookup(uid_t *uid, gid_t *gid, int direction, struct pf_pdesc *pd)
}
#ifdef __FreeBSD__
INP_LOCK(inp);
+ if ((inp->inp_socket == NULL) || (inp->inp_socket->so_cred == NULL)) {
+ INP_UNLOCK(inp);
+ INP_INFO_RUNLOCK(pi);
+ return (0);
+ }
*uid = inp->inp_socket->so_cred->cr_uid;
*gid = inp->inp_socket->so_cred->cr_groups[0];
INP_UNLOCK(inp);
OpenPOWER on IntegriCloud