aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Gurney <jmg@FreeBSD.org>2006-03-29 18:15:30 +0000
committerJohn-Mark Gurney <jmg@FreeBSD.org>2006-03-29 18:15:30 +0000
commit4e095bc04535a4d0d0205ecb131a3e0eb8361bed (patch)
tree874f4cf90b574922a11af8144718074cfb474a97
parent029c3cdf55012980ae43290ad2e97e9178919cae (diff)
downloadsrc-4e095bc04535a4d0d0205ecb131a3e0eb8361bed.tar.gz
src-4e095bc04535a4d0d0205ecb131a3e0eb8361bed.zip
hold the list lock over the f_event and KNOTE_ACTIVATE calls... This closes
a race where data could come in before we clear the INFLUX flag, and get skipped over by knote (and hence never be activated, though it should of been)... Found by: glebius & co. Reviewed by: glebius MFC after: 3 days
Notes
Notes: svn path=/head/; revision=157267
-rw-r--r--sys/kern/kern_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index 341910162454..8fdcb8dc89a5 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -923,11 +923,11 @@ findkn:
* which will remove it from the list, and NULL kn_knlist.
*/
event = kn->kn_fop->f_event(kn, 0);
- KN_LIST_UNLOCK(kn);
KQ_LOCK(kq);
if (event)
KNOTE_ACTIVATE(kn, 1);
kn->kn_status &= ~KN_INFLUX;
+ KN_LIST_UNLOCK(kn);
} else if (kev->flags & EV_DELETE) {
kn->kn_status |= KN_INFLUX;
KQ_UNLOCK(kq);