diff options
author | mlaier <mlaier@FreeBSD.org> | 2004-10-24 19:35:02 +0000 |
---|---|---|
committer | mlaier <mlaier@FreeBSD.org> | 2004-10-24 19:35:02 +0000 |
commit | a18af33877fa2d0d101b28b41dc3e19f16cbde0c (patch) | |
tree | 57ae03d4d50e490e6eb7d43cc1b2ebad7e38134f /sys/contrib | |
parent | 0041f5bef40a72af5bca742616209ccb2ef3761b (diff) | |
download | FreeBSD-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.c | 5 |
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); |