Return EOPNOTSUPP for fnullop_kqfilter to prevent registration of unsupported

fds. XXX: We should really fix the fd's to be supported in the future.
Unsupported fd's have a NULL f_event, so registering crashes the kernel with
a NULL function dereference of f_event.
This commit is contained in:
christos 2012-11-24 15:07:44 +00:00
parent 0156034a08
commit 7e72d438b2
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_descrip.c,v 1.218 2012/01/25 00:28:35 christos Exp $ */
/* $NetBSD: kern_descrip.c,v 1.219 2012/11/24 15:07:44 christos Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.218 2012/01/25 00:28:35 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.219 2012/11/24 15:07:44 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -1885,7 +1885,7 @@ int
fnullop_kqfilter(file_t *fp, struct knote *kn)
{
return 0;
return EOPNOTSUPP;
}
void