summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-01-06 22:28:28 +0000
committerrwatson <rwatson@FreeBSD.org>2007-01-06 22:28:28 +0000
commit6ac99f71137b7f6e2bc1c532ff007193ce5d6efe (patch)
tree639f3c2bf0f2c02ebb247bffd4c0fbfb4f741b90 /sys/security
parente8188b5da15f9dd7ff5fe08d32510b2f0c97914e (diff)
downloadFreeBSD-src-6ac99f71137b7f6e2bc1c532ff007193ce5d6efe.zip
FreeBSD-src-6ac99f71137b7f6e2bc1c532ff007193ce5d6efe.tar.gz
When returning early from audit_arg_file() due to so->so_pcb being NULL
(due to an early reset or the like), remember to unlock the socket lock. This will not occur in 7-CURRENT, but could in theory occur in 6-STABLE. MFC after: 1 week
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/audit/audit_arg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c
index f4f9373..7ec68a1 100644
--- a/sys/security/audit/audit_arg.c
+++ b/sys/security/audit/audit_arg.c
@@ -619,8 +619,10 @@ audit_arg_file(struct proc *p, struct file *fp)
so = (struct socket *)fp->f_data;
SOCK_LOCK(so);
if (INP_CHECK_SOCKAF(so, PF_INET)) {
- if (so->so_pcb == NULL)
+ if (so->so_pcb == NULL) {
+ SOCK_UNLOCK(so);
return;
+ }
ar->k_ar.ar_arg_sockinfo.so_type =
so->so_type;
ar->k_ar.ar_arg_sockinfo.so_domain =
@@ -645,7 +647,6 @@ audit_arg_file(struct proc *p, struct file *fp)
/* XXXAUDIT: else? */
break;
}
-
}
/*
OpenPOWER on IntegriCloud