Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Return EOPNOTSUPP for fnullop_kqfilter to prevent r...



details:   https://anonhg.NetBSD.org/src/rev/228e59b62c95
branches:  trunk
changeset: 782870:228e59b62c95
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Nov 24 15:07:44 2012 +0000

description:
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.

diffstat:

 sys/kern/kern_descrip.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r d483f49e9950 -r 228e59b62c95 sys/kern/kern_descrip.c
--- a/sys/kern/kern_descrip.c   Sat Nov 24 15:05:45 2012 +0000
+++ b/sys/kern/kern_descrip.c   Sat Nov 24 15:07:44 2012 +0000
@@ -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 @@
 fnullop_kqfilter(file_t *fp, struct knote *kn)
 {
 
-       return 0;
+       return EOPNOTSUPP;
 }
 
 void



Home | Main Index | Thread Index | Old Index