Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Prevent poll and kqueue on the control endpoint.
details: https://anonhg.NetBSD.org/src/rev/76fcb21cf08c
branches: trunk
changeset: 771561:76fcb21cf08c
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Fri Nov 25 02:59:54 2011 +0000
description:
Prevent poll and kqueue on the control endpoint.
Addresses PR#33352.
(The control endpoint doesn't support pipes, so this would be of dubious
usefulness even if it didn't expose bugs.)
diffstat:
sys/dev/usb/ugen.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (38 lines):
diff -r 8a8a60ddb371 -r 76fcb21cf08c sys/dev/usb/ugen.c
--- a/sys/dev/usb/ugen.c Fri Nov 25 01:39:47 2011 +0000
+++ b/sys/dev/usb/ugen.c Fri Nov 25 02:59:54 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ugen.c,v 1.112 2011/11/20 22:27:39 gavan Exp $ */
+/* $NetBSD: ugen.c,v 1.113 2011/11/25 02:59:54 jakllsch Exp $ */
/*
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.112 2011/11/20 22:27:39 gavan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.113 2011/11/25 02:59:54 jakllsch Exp $");
#include "opt_compat_netbsd.h"
@@ -1866,6 +1866,9 @@
if (sc->sc_dying)
return (POLLHUP);
+ if (UGENENDPOINT(dev) == USB_CONTROL_ENDPOINT)
+ return ENODEV;
+
sce_in = &sc->sc_endpoints[UGENENDPOINT(dev)][IN];
sce_out = &sc->sc_endpoints[UGENENDPOINT(dev)][OUT];
if (sce_in == NULL && sce_out == NULL)
@@ -2053,6 +2056,9 @@
if (sc->sc_dying)
return (ENXIO);
+ if (UGENENDPOINT(dev) == USB_CONTROL_ENDPOINT)
+ return ENODEV;
+
switch (kn->kn_filter) {
case EVFILT_READ:
sce = &sc->sc_endpoints[UGENENDPOINT(dev)][IN];
Home |
Main Index |
Thread Index |
Old Index