When auditing state from an IPv4 or IPv6 socket, use read locks on the

inpcb rather than write locks.

MFC after:	3 months
This commit is contained in:
Robert Watson 2008-04-19 18:37:08 +00:00
parent 211b72ad2f
commit 1a46aa801e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=178322

View File

@ -649,7 +649,7 @@ audit_arg_file(struct proc *p, struct file *fp)
so->so_proto->pr_protocol;
SOCK_UNLOCK(so);
pcb = (struct inpcb *)so->so_pcb;
INP_WLOCK(pcb);
INP_RLOCK(pcb);
ar->k_ar.ar_arg_sockinfo.so_raddr =
pcb->inp_faddr.s_addr;
ar->k_ar.ar_arg_sockinfo.so_laddr =
@ -658,7 +658,7 @@ audit_arg_file(struct proc *p, struct file *fp)
pcb->inp_fport;
ar->k_ar.ar_arg_sockinfo.so_lport =
pcb->inp_lport;
INP_WUNLOCK(pcb);
INP_RUNLOCK(pcb);
ARG_SET_VALID(ar, ARG_SOCKINFO);
}
break;