aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2007-02-20 13:38:11 +0000
committerRobert Watson <rwatson@FreeBSD.org>2007-02-20 13:38:11 +0000
commita1f3b8390c45f96e6a566613c5f8d97170a77006 (patch)
treef5e4e3251335dfd94f064dfba851150d6613d894
parent5b950deabc7acd66e569fc7642df46928ac4ff5b (diff)
Notes
-rw-r--r--sys/security/audit/audit_arg.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c
index 7ec68a126d5cc..5147e29df8167 100644
--- a/sys/security/audit/audit_arg.c
+++ b/sys/security/audit/audit_arg.c
@@ -617,19 +617,17 @@ audit_arg_file(struct proc *p, struct file *fp)
case DTYPE_SOCKET:
so = (struct socket *)fp->f_data;
- SOCK_LOCK(so);
if (INP_CHECK_SOCKAF(so, PF_INET)) {
- if (so->so_pcb == NULL) {
- SOCK_UNLOCK(so);
- return;
- }
+ SOCK_LOCK(so);
ar->k_ar.ar_arg_sockinfo.so_type =
so->so_type;
ar->k_ar.ar_arg_sockinfo.so_domain =
INP_SOCKAF(so);
ar->k_ar.ar_arg_sockinfo.so_protocol =
so->so_proto->pr_protocol;
+ SOCK_UNLOCK(so);
pcb = (struct inpcb *)so->so_pcb;
+ INP_LOCK(pcb);
ar->k_ar.ar_arg_sockinfo.so_raddr =
pcb->inp_faddr.s_addr;
ar->k_ar.ar_arg_sockinfo.so_laddr =
@@ -638,9 +636,9 @@ audit_arg_file(struct proc *p, struct file *fp)
pcb->inp_fport;
ar->k_ar.ar_arg_sockinfo.so_lport =
pcb->inp_lport;
+ INP_UNLOCK(pcb);
ARG_SET_VALID(ar, ARG_SOCKINFO);
}
- SOCK_UNLOCK(so);
break;
default: