From owner-svn-src-head@freebsd.org Wed Nov 29 12:42:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2572E531F5; Wed, 29 Nov 2017 12:42:48 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F31B72D05; Wed, 29 Nov 2017 12:42:47 +0000 (UTC) (envelope-from o.hartmann@walstatt.org) Received: from hermann ([78.52.117.12]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Lxgnf-1fCeOu2zCl-017Dnn; Wed, 29 Nov 2017 13:42:43 +0100 Date: Wed, 29 Nov 2017 13:42:42 +0100 From: "Hartmann, O." To: Hans Petter Selasky Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Hartmann, O." Subject: Re: svn commit: r326362 - in head: share/man/man4 sys/net Message-ID: <20171129134228.4c7bcefe@hermann> In-Reply-To: References: <201711290940.vAT9eBWV096246@repo.freebsd.org> <20171129115125.24dd4aa0@hermann> <20171129131556.2247c97c@hermann> Organization: walstatt.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:Z7qP7NNlbwWBRpvoIv3M0oAHOiH56T6hhUqRJt8NEse2dcBy3KG YJgXA+VuQfocvhmQvJh5ZcbnNWAxW7hW4swi9YFESQpbaiJcJl/EYH4FDhThpodQZGFCJ3j JNjElbpnXvJA+eWWYcLFWHDj643pgjpnf3oVbjd8d/rJQsL0pFhWZ7TFI0SYUVnpoA1fmhO 1a6mBtuwCS8VxvHvgdqFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:uuLTo60x+RI=:b4jqrH/cZXjzPsdQHIBle6 e7QCUmMOKT6XPBdF0f3DTlAcf5ZCOX5xPZR4x0hR7IQhxRCIiDPl7L8mkID4ei3PNpcqphXKl 12GlJFKl9iKYbbq4wEaV3fO+L9p15z6h1TSgn+AHf7wnoiWFAZItyoRVyg0qVBMXtLdqdGFD8 wpTXtsOoZKArsLzn2sP25POJW89K9xspXIcxfZubtw6izbE8Pb4KOKOKISwo6gaaKBSFzaDxV mMpB/d+K8e8cgJKvHdTHQ+a8ngrVhoJyWY7MU0qxX+6FzkbRQDxS2LSFDhgI+9dttVZYNyO7r 9XTYCiZuxjJmMm4z6S1Hke8hS1YYvPFe7bE639jsE2v2pyz3Rejk4QARJrH6wyAelJAQIhXsd x5ykGJg+b7OMv8/HZ4iDgNRzv72+9E/fKrKyHRvUGdvZeAGLmN833vJOadb3SiNoteyj5FeEW j3Y+gXJLjEjZO9ubKTiBuwnv51WW0gRvj0nF96kcqu+5Hnks0mNMk+evA13Ez3N0zq/HetL+L HUQDU21o0tdILGPAuq2GhtJYpdSR2FASadqlRZU133yuEnWZhMwPTjFZZMGWL+3/fAxxjSQjR HIAwIYnPBHtKor4Iy4v8hBtfwLyyeQd4VuoBH8WEY2qOrhwNB8gOznXCWw/JLTZBe2PQY1FAX snUEeU1UtqYX3BpnGU/boOxyw/LBjuTi3NvVbbDRcGSuY87rl4/dMbxG/YvFfYFBLd27atTLv J/GIA5NeSweDDE3eHg7ShglrsvkAaNZF0XRg3SM8K5CpNFHpZers67Hw8VZEtgBQR5Zr/sDoq gpW3bkoECCj4Q/iojT1WXIJtRGhqmmKpD3Nli04I6S/HnEuvM8= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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: Wed, 29 Nov 2017 12:42:48 -0000 On Wed, 29 Nov 2017 13:16:28 +0100 Hans Petter Selasky wrote: > On 11/29/17 13:16, Hartmann, O. wrote: > > On Wed, 29 Nov 2017 12:49:19 +0100 > > Hans Petter Selasky wrote: > > > >> On 11/29/17 11:51, Hartmann, O. wrote: > >>> On Wed, 29 Nov 2017 09:40:11 +0000 (UTC) > >>> Hans Petter Selasky wrote: > >>> > >>>> Author: hselasky > >>>> Date: Wed Nov 29 09:40:11 2017 > >>>> New Revision: 326362 > >>>> URL: https://svnweb.freebsd.org/changeset/base/326362 > >>>> > >>>> Log: > >>>> Disallow TUN and TAP character device IOCTLs to modify the > >>>> network device type to any value. This can cause page faults and > >>>> panics due to accessing uninitialized fields in the "struct > >>>> ifnet" which are specific to the network device type. > >>>> > >>>> MFC after: 1 week > >>>> Found by: jau@iki.fi > >>>> PR: 223767 > >>>> Sponsored by: Mellanox Technologies > >>>> > >>>> Modified: > >>>> head/share/man/man4/tap.4 > >>>> head/share/man/man4/tun.4 > >>>> head/sys/net/if_tap.c > >>>> head/sys/net/if_tun.c > >>>> > >>>> Modified: head/share/man/man4/tap.4 > >>>> ============================================================================== > >>>> --- head/share/man/man4/tap.4 Wed Nov 29 09:18:24 2017 > >>>> (r326361) +++ head/share/man/man4/tap.4 Wed Nov 29 > >>>> 09:40:11 2017 (r326362) @@ -1,7 +1,7 @@ > >>>> .\" $FreeBSD$ > >>>> .\" Based on PR#2411 > >>>> .\" > >>>> -.Dd April 10, 2015 > >>>> +.Dd November 29, 2017 > >>>> .Dt TAP 4 > >>>> .Os > >>>> .Sh NAME > >>>> @@ -171,7 +171,14 @@ calls are supported > >>>> .In net/if_tap.h ) : > >>>> .Bl -tag -width VMIO_SIOCSETMACADDR > >>>> .It Dv TAPSIFINFO > >>>> -Set network interface information (line speed, MTU and type). > >>>> +Set network interface information (line speed and MTU). > >>>> +The type must be the same as returned by > >>>> +.Dv TAPGIFINFO > >>>> +or set to > >>>> +.Dv IFT_ETHER > >>>> +else the > >>>> +.Xr ioctl 2 > >>>> +call will fail. > >>>> The argument should be a pointer to a > >>>> .Va struct tapinfo . > >>>> .It Dv TAPGIFINFO > >>>> > >>>> Modified: head/share/man/man4/tun.4 > >>>> ============================================================================== > >>>> --- head/share/man/man4/tun.4 Wed Nov 29 09:18:24 2017 > >>>> (r326361) +++ head/share/man/man4/tun.4 Wed Nov 29 > >>>> 09:40:11 2017 (r326362) @@ -2,7 +2,7 @@ > >>>> .\" $FreeBSD$ > >>>> .\" Based on PR#2411 > >>>> .\" > >>>> -.Dd November 30, 2014 > >>>> +.Dd November 29, 2017 > >>>> .Dt TUN 4 > >>>> .Os > >>>> .Sh NAME > >>>> @@ -208,8 +208,15 @@ this stores the internal debugging > >>>> variable's value in .It Dv TUNSIFINFO > >>>> The argument should be a pointer to an > >>>> .Vt struct tuninfo > >>>> -and allows setting the MTU, the type, and the baudrate of the > >>>> tunnel +and allows setting the MTU and the baudrate of the tunnel > >>>> device. > >>>> +The type must be the same as returned by > >>>> +.Dv TUNGIFINFO > >>>> +or set to > >>>> +.Dv IFT_PPP > >>>> +else the > >>>> +.Xr ioctl 2 > >>>> +call will fail. > >>>> The > >>>> .Vt struct tuninfo > >>>> is declared in > >>>> > >>>> Modified: head/sys/net/if_tap.c > >>>> ============================================================================== > >>>> --- head/sys/net/if_tap.c Wed Nov 29 09:18:24 2017 > >>>> (r326361) +++ head/sys/net/if_tap.c Wed Nov 29 09:40:11 > >>>> 2017 (r326362) @@ -737,9 +737,10 @@ tapioctl(struct cdev > >>>> *dev, u_long cmd, caddr_t data, i switch (cmd) { > >>>> case TAPSIFINFO: > >>>> tapp = (struct tapinfo *)data; > >>>> + if (ifp->if_type != tapp->type) > >>>> + return (EPROTOTYPE); > >>>> mtx_lock(&tp->tap_mtx); > >>>> ifp->if_mtu = tapp->mtu; > >>>> - ifp->if_type = tapp->type; > >>>> ifp->if_baudrate = tapp->baudrate; > >>>> mtx_unlock(&tp->tap_mtx); > >>>> break; > >>>> > >>>> Modified: head/sys/net/if_tun.c > >>>> ============================================================================== > >>>> --- head/sys/net/if_tun.c Wed Nov 29 09:18:24 2017 > >>>> (r326361) +++ head/sys/net/if_tun.c Wed Nov 29 09:40:11 > >>>> 2017 (r326362) @@ -676,9 +676,10 @@ tunioctl(struct cdev > >>>> *dev, u_long cmd, caddr_t data, i if (error) > >>>> return (error); > >>>> } > >>>> + if (TUN2IFP(tp)->if_type != tunp->type) > >>>> + return (EPROTOTYPE); > >>>> mtx_lock(&tp->tun_mtx); > >>>> TUN2IFP(tp)->if_mtu = tunp->mtu; > >>>> - TUN2IFP(tp)->if_type = tunp->type; > >>>> TUN2IFP(tp)->if_baudrate = tunp->baudrate; > >>>> mtx_unlock(&tp->tun_mtx); > >>>> break; > >>>> _______________________________________________ > >>>> svn-src-head@freebsd.org mailing list > >>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head > >>>> To unsubscribe, send any mail to > >>>> "svn-src-head-unsubscribe@freebsd.org" > >>> > >>> after updating from r325893 to r326362, FreeBSD CURRENT crashes > >>> while booting the kernel. I'm sorry having no further > >>> informations, it happens on a laptop with reduced space. > >>> > >>> At the moment, it seems that a lot of boxes running most recent > >>> CURRENT tend to crash spontanously. > >>> > >> > >> Hi, > >> > >> And you built the kernel from scratch and made sure your source > >> tree does not contain any .o files nor /usr/obj/* . > >> > >> --HPS > > > > Last time I did the make cleandir was when the OFED driver problem > > occured, that was some days ago. Useually, I build world and kernel > > with WITH_META_MODE set. > > > > Hi, > > Try to do a clean build w/o META mode. > > rm -rf /usr/obj/* > > And check: > > find /usr/src -name "*.o" > > --HPS I just started a while ago after "make cleanworld" - which seems to kill all subsequent folders in /usr/obj or whatever MAKEOBJDIRPREFIX path is set. I hope this suffice for thew moment, my hardware is not the fastest. Sincerely oh