diff options
author | kib <kib@FreeBSD.org> | 2010-02-14 13:59:01 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2010-02-14 13:59:01 +0000 |
commit | 473b74afba8771715a067e7e2928f0b53789887b (patch) | |
tree | cca285c556526bbebc3d15516da4d88fd66218f2 /sys/kern | |
parent | 1bb580c8e7ac325bb28c63b43caac2ed3dbd4310 (diff) | |
download | FreeBSD-src-473b74afba8771715a067e7e2928f0b53789887b.zip FreeBSD-src-473b74afba8771715a067e7e2928f0b53789887b.tar.gz |
Do not leak process lock when current thread is not allowed to see target.
Bumped into by: ed
MFC after: 3 days
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_event.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c index 0ba6c81..cb418fb 100644 --- a/sys/kern/kern_event.c +++ b/sys/kern/kern_event.c @@ -349,8 +349,10 @@ filt_procattach(struct knote *kn) if (p == NULL) return (ESRCH); - if ((error = p_cansee(curthread, p))) + if ((error = p_cansee(curthread, p))) { + PROC_UNLOCK(p); return (error); + } kn->kn_ptr.p_proc = p; kn->kn_flags |= EV_CLEAR; /* automatically set */ |