From owner-svn-src-head@FreeBSD.ORG Fri Sep 5 19:50:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F31636D9; Fri, 5 Sep 2014 19:50:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEC6414A5; Fri, 5 Sep 2014 19:50:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s85JoIHn000445; Fri, 5 Sep 2014 19:50:18 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s85JoI3r000416; Fri, 5 Sep 2014 19:50:18 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201409051950.s85JoI3r000416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 5 Sep 2014 19:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271182 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Sep 2014 19:50:19 -0000 Author: glebius Date: Fri Sep 5 19:50:18 2014 New Revision: 271182 URL: http://svnweb.freebsd.org/changeset/base/271182 Log: Set vnet context before accessing V_socket_hhh[]. Submitted by: "Hiroo Ono (小野寛生)" Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Sep 5 19:00:30 2014 (r271181) +++ head/sys/kern/uipc_socket.c Fri Sep 5 19:50:18 2014 (r271182) @@ -3265,9 +3265,11 @@ filt_soread(struct knote *kn, long hint) return 1; } + CURVNET_SET(so->so_vnet); if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) /* This hook returning non-zero indicates an event, not error */ return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); + CURVNET_RESTORE(); return (0); } @@ -3294,8 +3296,10 @@ filt_sowrite(struct knote *kn, long hint SOCKBUF_LOCK_ASSERT(&so->so_snd); kn->kn_data = sbspace(&so->so_snd); + CURVNET_SET(so->so_vnet); if (V_socket_hhh[HHOOK_FILT_SOWRITE]->hhh_nhooks > 0) hhook_run_socket(so, kn, HHOOK_FILT_SOWRITE); + CURVNET_RESTORE(); if (so->so_snd.sb_state & SBS_CANTSENDMORE) { kn->kn_flags |= EV_EOF;