Module Name: src Committed By: msaitoh Date: Tue Jun 3 15:13:30 UTC 2014
Modified Files: src/sys/net [netbsd-6]: if_tap.c Log Message: Pull up following revision(s) (requested by cube in ticket #1071): sys/net/if_tap.c 1.76 Prevent a race between tap_dev_poll() and tap_start() by making sure the call to selrecord() happens at splnet(). Fixes kern/47506 and kern/46199. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.66.14.1 src/sys/net/if_tap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/if_tap.c diff -u src/sys/net/if_tap.c:1.66 src/sys/net/if_tap.c:1.66.14.1 --- src/sys/net/if_tap.c:1.66 Mon Nov 22 21:31:51 2010 +++ src/sys/net/if_tap.c Tue Jun 3 15:13:30 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tap.c,v 1.66 2010/11/22 21:31:51 christos Exp $ */ +/* $NetBSD: if_tap.c,v 1.66.14.1 2014/06/03 15:13:30 msaitoh Exp $ */ /* * Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation. @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.66 2010/11/22 21:31:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.66.14.1 2014/06/03 15:13:30 msaitoh Exp $"); #if defined(_KERNEL_OPT) @@ -1164,7 +1164,6 @@ tap_dev_poll(int unit, int events, struc s = splnet(); IFQ_POLL(&ifp->if_snd, m); - splx(s); if (m != NULL) revents |= events & (POLLIN|POLLRDNORM); @@ -1173,6 +1172,7 @@ tap_dev_poll(int unit, int events, struc selrecord(l, &sc->sc_rsel); simple_unlock(&sc->sc_kqlock); } + splx(s); } revents |= events & (POLLOUT|POLLWRNORM);