summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_event.c
diff options
context:
space:
mode:
authorrodrigc <rodrigc@FreeBSD.org>2007-07-14 21:18:19 +0000
committerrodrigc <rodrigc@FreeBSD.org>2007-07-14 21:18:19 +0000
commitdef1240ba27369b4e457dc3a8adf7d667aaa3744 (patch)
tree104b3b3840b5ebffddfa7133189f3243964ec2a9 /sys/kern/kern_event.c
parent5cecbb94f32cae3d5f2c4f4e6085bfc06f4b9508 (diff)
downloadFreeBSD-src-def1240ba27369b4e457dc3a8adf7d667aaa3744.zip
FreeBSD-src-def1240ba27369b4e457dc3a8adf7d667aaa3744.tar.gz
The last entry in the ext2_opts array must be NULL,
otherwise the kernel with crash in vfs_filteropt() if an invalid mount option is passed to ext2fs. Approved by: re (kensmith)
Diffstat (limited to 'sys/kern/kern_event.c')
-rw-r--r--sys/kern/kern_event.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_event.c b/sys/kern/kern_event.c
index aa446b6..f7f9f1c 100644
--- a/sys/kern/kern_event.c
+++ b/sys/kern/kern_event.c
@@ -1059,6 +1059,15 @@ kqueue_expand(struct kqueue *kq, struct filterops *fops, uintptr_t ident,
int fd;
int mflag = waitok ? M_WAITOK : M_NOWAIT;
+ /*
+ * knote locks the KQ and filt_proc calls kqueue_register if _TRACK
+ * is set. Return early so we don't assert KQ_NOTOWNED in this
+ * case. We have a knote in the hash, so we have the table.
+ */
+ if ((fops->f_isfd && kq->kq_knlistsize > ident) ||
+ (!fops->f_isfd && kq->kq_knhashmask != 0))
+ return 0;
+
KQ_NOTOWNED(kq);
if (fops->f_isfd) {
OpenPOWER on IntegriCloud