From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 17 07:28:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33D4F16A4CE for ; Sat, 17 Apr 2004 07:28:17 -0700 (PDT) Received: from www.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id A53C743D3F for ; Sat, 17 Apr 2004 07:28:16 -0700 (PDT) (envelope-from kai@freshx.de) Received: from localhost (unknown [127.0.0.1]) by www.freshx.de (Postfix) with ESMTP id 46D0E15E29F; Sat, 17 Apr 2004 16:28:15 +0200 (CEST) Received: from localhost (unknown [127.0.0.1]) by www.freshx.de (Postfix) with ESMTP id E7D7815E0B0; Sat, 17 Apr 2004 16:28:14 +0200 (CEST) Received: from 127.0.0.1 ( [127.0.0.1]) as user dust0005@localhost by localhost with HTTP; Sat, 17 Apr 2004 16:28:14 +0200 Message-ID: <1082212094.40813efed9089@localhost> Date: Sat, 17 Apr 2004 16:28:14 +0200 From: kai@freshx.de To: Mark References: <200404171419.I3HEJNLH042774@asarian-host.net> In-Reply-To: <200404171419.I3HEJNLH042774@asarian-host.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.0 X-Virus-Scanned: by AMaViS 0.3.12 X-Mailman-Approved-At: Sun, 18 Apr 2004 04:54:15 -0700 cc: freebsd-hackers@freebsd.org Subject: Re: Does FreeBSD 4.9R-p3 support the 3Com 3C940 LAN card? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Apr 2004 14:28:17 -0000 Hi Mark, as the man page states : The sk driver provides support for the SysKonnect SK-984x and SK-982x series PCI gigabit ethernet adapters, including the following: o 3COM 3C940 single port, 1000baseT adapter o Linksys EG1032 single port, 1000baseT adapter o SK-9521 SK-NET GE-T single port, 1000baseT adapter o SK-9821 SK-NET GE-T single port, 1000baseT adapter o SK-9822 SK-NET GE-T dual port, 1000baseT adapter o SK-9841 SK-NET GE-LX single port, single mode fiber adapter o SK-9842 SK-NET GE-LX dual port, single mode fiber adapter o SK-9843 SK-NET GE-SX single port, multimode fiber adapter o SK-9844 SK-NET GE-SX dual port, multimode fiber adapter o SMC 9452TX single port, 1000baseT adapter Best Kai > Hello, > > Does FreeBSD 4.9R-p3 support the 3Com 3C940 LAN card? The 3Com 3C940 does > not appear on either the 5.x or 4.9 hardware list, but someone one the > freebsd-questions list said I should try the sk(4) driver. Which I do not > quite understand; as: > > device sk # SysKonnect SK-984x and SK-982x gigabit ethernet > > Seems to support a different kind of NIC. Can someone please clarify this > for me? > > Thanks! > > - Mark > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 18 08:16:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 373B616A4CE for ; Sun, 18 Apr 2004 08:16:22 -0700 (PDT) Received: from asarian-host.net (mail.asarian-host.net [194.109.160.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E21943D58 for ; Sun, 18 Apr 2004 08:16:21 -0700 (PDT) SRS0=xL7VAITN=HO=asarian-host.net=admin@asarian-host.net) Comments: To protect the identity of the sender, certain header fields are either not shown, or masked. Anonymous email accounts can be requested by filling in the appropriate form at: https://asarian-host.net/cgi-bin/signup.cgi Received: (from root@localhost) by mail.asarian-host.net (8.12.11/8.12.11) id i3IFGJOh039826 for freebsd-hackers@freebsd.org; Sun, 18 Apr 2004 17:16:19 +0200 (CEST) (envelope-from admin@asarian-host.net) From: Mark Received-SPF: pass (asarian-host.net: domain of admin@asarian-host.net designates sender IP as SASL permitted sender) Message-Id: <200404181516.I3IFGIQ6039814@asarian-host.net> Date: Sun, 18 Apr 2004 15:16:19 GMT X-Authenticated-Sender: admin@asarian-host.net X-Trace: 9/MTHkl5rV6llnw/JjEheUk5F6jBQkX2bA10YAOTSyqR9xmQPwgMLMrA1bMm3R6O49ec7Pujr7vO0wXEWpxcLg== X-Complaints-To: abuse@asarian-host.net X-Abuse-Info: Please be sure to forward a copy of ALL headers, otherwise we are unable to process your complaint Organization: Asarian-host To: MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Auth: Asarian-host PGP signature iQEVAwUAQIKbwzFqW1BleBN9AQG7jQf/WixvSQxV2y2qskAeL6CDITBRvoKxneVe kEP7kZY+sT441sWxIrJf/UgPGI/Fz2nsUfXiInLSWJBgVdtzctN0PmxICi3znAqj IC8APxA9/z8rpUL8lCJD6yw7eWJP9XZapmL9HG1x0YnAkur2pIc854iUYXXiiK9s dRJurP7pyVZMjN15oj89Td+beRz9gBpQEzUDZ0i65JxXKljxVOlbyDqVHdousq9d PeQ9uQvPNPydvUFoi+V/13JB7Glc08wpW1qPRGE5OnDZbUs1ruDaNALI77szd4DT AkL+tv2GSWAuVSzlA3rGA8wsvhBtEZQJ0B8uhlvX4OUEzPZMTJwfpA== =L601 Subject: ADI AD1980 6-channel audio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2004 15:16:22 -0000 Hello, I plan to install FreeBSD 4.9R-p4 on an ASUS K8V Deluxe board. The board has an oboard ADI AD1980 6-channel audio chip. Is that supported? The 4.9R hardware compatibility list does not list a whole lot of devices. Thanks, - Mark From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 18 09:57:50 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4814D16A4CE for ; Sun, 18 Apr 2004 09:57:50 -0700 (PDT) Received: from cg.c.is (mail.hallo.is [193.4.194.51]) by mx1.FreeBSD.org (Postfix) with ESMTP id 83D8E43D45 for ; Sun, 18 Apr 2004 09:57:49 -0700 (PDT) (envelope-from thib@heimsnet.is) Received: from caulfield (bofh.bitcode.org [213.220.74.36]) by cg.c.is (8.12.9/8.12.9) with SMTP id i3IGvlkF958578 for ; Sun, 18 Apr 2004 16:57:48 GMT Date: Sun, 18 Apr 2004 16:58:32 +0000 From: thib To: freebsd-hackers@freebsd.org Message-Id: <20040418165832.179d4178.thib@heimsnet.is> In-Reply-To: <200404181516.I3IFGIQ6039814@asarian-host.net> References: <200404181516.I3IFGIQ6039814@asarian-host.net> Organization: N/a X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: ADI AD1980 6-channel audio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Apr 2004 16:57:50 -0000 On Sun, 18 Apr 2004 15:16:19 GMT Mark wrote: > Hello, > > I plan to install FreeBSD 4.9R-p4 on an ASUS K8V Deluxe board. The board has > an oboard ADI AD1980 6-channel audio chip. Is that supported? The 4.9R > hardware compatibility list does not list a whole lot of devices. > > Thanks, > > - Mark > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" This would be a questions and -questions is for questions, but still "device pcm" should work. If not then I have no idea :) From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 18 19:36:11 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8E4F816A4CE for ; Sun, 18 Apr 2004 19:36:11 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCF6F43D39 for ; Sun, 18 Apr 2004 19:36:10 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (203.134.132.97) by smtp01.syd.iprimus.net.au (7.0.024) id 402BA92701888267; Mon, 19 Apr 2004 12:36:03 +1000 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id F157A41C8; Mon, 19 Apr 2004 13:38:48 +1000 (EST) Date: Mon, 19 Apr 2004 13:38:48 +1000 From: Tim Robbins To: Mark Message-ID: <20040419033848.GA10708@cat.robbins.dropbear.id.au> References: <200404181516.I3IFGIQ6039814@asarian-host.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404181516.I3IFGIQ6039814@asarian-host.net> User-Agent: Mutt/1.4.1i cc: freebsd-hackers@freebsd.org Subject: Re: ADI AD1980 6-channel audio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 02:36:11 -0000 On Sun, Apr 18, 2004 at 03:16:19PM +0000, Mark wrote: > Hello, > > I plan to install FreeBSD 4.9R-p4 on an ASUS K8V Deluxe board. The board has > an oboard ADI AD1980 6-channel audio chip. Is that supported? The 4.9R > hardware compatibility list does not list a whole lot of devices. I have this same board. FreeBSD 5.2.1/amd64 supports all of the onboard hardware, including sound, network, USB 2.0, VIA ATA/SATA, Promise SATA, and FireWire. ACPI support is also fully functional. I haven't tried 4.9, but I expect that most are supported; out of interest, though, why are you not running an amd64 release? Tim From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 18 20:02:01 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8630516A4CE for ; Sun, 18 Apr 2004 20:02:01 -0700 (PDT) Received: from asarian-host.net (mail.asarian-host.net [194.109.160.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD71643D5F for ; Sun, 18 Apr 2004 20:02:00 -0700 (PDT) SRS0=XjnANR7+=HP=asarian-host.net=admin@asarian-host.net) Comments: To protect the identity of the sender, certain header fields are either not shown, or masked. Anonymous email accounts can be requested by filling in the appropriate form at: https://asarian-host.net/cgi-bin/signup.cgi Received: (from root@localhost) by mail.asarian-host.net (8.12.11/8.12.11) id i3J31xZe075323 for freebsd-hackers@freebsd.org; Mon, 19 Apr 2004 05:01:59 +0200 (CEST) (envelope-from admin@asarian-host.net) From: Mark Received-SPF: pass (asarian-host.net: domain of admin@asarian-host.net designates sender IP as SASL permitted sender) Message-Id: <200404190301.I3J31WIN075303@asarian-host.net> Date: Mon, 19 Apr 2004 03:01:59 GMT X-Authenticated-Sender: admin@asarian-host.net X-Trace: tOMBhE1oJp0yptHAsmzdowVDEnePKiTqSuxy+fvRTA4qpfq/6+yBy4iKtctFhlEmX6MRtXcq5m6BIpwdaHCRQA== X-Complaints-To: abuse@asarian-host.net X-Abuse-Info: Please be sure to forward a copy of ALL headers, otherwise we are unable to process your complaint Organization: Asarian-host To: "Tim Robbins" References: <200404181516.I3IFGIQ6039814@asarian-host.net> <20040419033848.GA10708@cat.robbins.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Auth: Asarian-host PGP signature iQEVAwUAQINBJzFqW1BleBN9AQFX9Qf/YomazqKmstGVDfwxrFHI/tm/xYM8+e7C YB7c1sZR0hFH599rXZgRww5y7CL9OJKnanhYRAGLI1XbI9W5RoJxFoqbww+Pr2Je ip/g9xPQ1aLADk4oErhgRWioIckZACBoDTo7ushxdrjHUOYBd1UYcZfc+72mwf0R Q9xtSfv5VDTeF+16xMYvy4zCwtDZb4EopUOXPIMEWijJoSlaz991xb+/Uy9KXgvU 9kNPxz+Qj+TRs19kwmdgfd02SXqRD342ziuTv8FDWhXPoePV1Bjoblu/4L3Vb5Fu L1st4n0ieIaRYg/A7alTOmf9ITKyxhZgElN2XzmRUk6A/LEmoeddRg== =i69A cc: freebsd-hackers@freebsd.org Subject: Re: ADI AD1980 6-channel audio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 03:02:01 -0000 Tim Robbins wrote: > On Sun, Apr 18, 2004 at 03:16:19PM +0000, Mark wrote: > >> Hello, >> >> I plan to install FreeBSD 4.9R-p4 on an ASUS K8V Deluxe board. The >> board has an oboard ADI AD1980 6-channel audio chip. Is that >> supported? The 4.9R hardware compatibility list does not list a >> whole lot of devices. > > I have this same board. FreeBSD 5.2.1/amd64 supports all of the > onboard hardware, including sound, network, USB 2.0, VIA ATA/SATA, > Promise SATA, and FireWire. ACPI support is also fully functional. I > haven't tried 4.9, but I expect that most are supported; out of > interest, though, why are you not running an amd64 release? Because I do not trust 5.x yet. There are way, way too many problems reported with it, daily, on the freebsd-questions list, for me to touch it with the proverbial ten-foot pole. :) Now, if a 4.9 release came out for amd64, that would be a different story, of course. I suspect the 32-bit kernel will run nicely on the AMD 64 too, though. I would have loved to have had SATA support for the VIA chipset (not yet in 4.9R). And if 5.x ever becomes stable (as stable as, say, my old 4.7R, which in several years has never spontaneously reset/hung (!)), I will gladly upgrade. But thanks for the encouraging glimps into the future, anyway. :) - Mark From owner-freebsd-hackers@FreeBSD.ORG Sun Apr 18 23:00:51 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E340416A5C9; Sun, 18 Apr 2004 23:00:51 -0700 (PDT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 45E1B43D5F; Sun, 18 Apr 2004 23:00:51 -0700 (PDT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id D80EB5319; Mon, 19 Apr 2004 08:00:49 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 3BCC85309; Mon, 19 Apr 2004 08:00:43 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id 20E2633C6C; Mon, 19 Apr 2004 08:00:43 +0200 (CEST) To: Mark References: <200404181516.I3IFGIQ6039814@asarian-host.net> <20040419033848.GA10708@cat.robbins.dropbear.id.au> <200404190301.I3J31WIN075303@asarian-host.net> From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Mon, 19 Apr 2004 08:00:42 +0200 In-Reply-To: <200404190301.I3J31WIN075303@asarian-host.net> (admin@asarian-host.net's message of "Mon, 19 Apr 2004 03:01:59 GMT") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 cc: freebsd-hackers@freebsd.org cc: Tim Robbins Subject: Re: ADI AD1980 6-channel audio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 06:00:52 -0000 Mark writes: > Because I do not trust 5.x yet. There are way, way too many problems > reported with it, daily, on the freebsd-questions list, for me to touch it > with the proverbial ten-foot pole. :) I really think you should do yourself a favor and try it out before dismissing it out of hand. It's a lot better than its reputation. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 19 00:11:15 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0743216A4CF for ; Mon, 19 Apr 2004 00:11:15 -0700 (PDT) Received: from mail.elvandar.org (cust.94.120.adsl.cistron.nl [195.64.94.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CB9E43D1F for ; Mon, 19 Apr 2004 00:11:14 -0700 (PDT) (envelope-from remko@elvandar.org) Received: from webmail.evilcoder.org (localhost.elvandar.intranet [127.0.0.1]) by mail.elvandar.org (Postfix) with SMTP id 9F95C1F for ; Mon, 19 Apr 2004 09:11:08 +0200 (CEST) Received: from proxy1.elvandar.org ([145.221.92.40]) (SquirrelMail authenticated user remko@evilcoder.org) by webmail.evilcoder.org with HTTP; Mon, 19 Apr 2004 09:11:08 +0200 (CEST) Message-ID: <56545.145.221.92.40.1082358668.squirrel@webmail.evilcoder.org> In-Reply-To: References: <200404181516.I3IFGIQ6039814@asarian-host.net><20040419033848.GA10708@cat.robbins.dropbear.id.au><200404190301.I3J31WIN075303@asarian-host.net> Date: Mon, 19 Apr 2004 09:11:08 +0200 (CEST) From: "Remko Lodder" To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Virus-Scanned: by amavisd-new at elvandar.org Subject: Re: ADI AD1980 6-channel audio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 07:11:15 -0000 > Mark writes: >> Because I do not trust 5.x yet. There are way, way too many problems >> reported with it, daily, on the freebsd-questions list, for me to touch >> it >> with the proverbial ten-foot pole. :) > > I really think you should do yourself a favor and try it out before > dismissing it out of hand. It's a lot better than its reputation. I Stick with DES here, i did not meet up any real troubles yet with the 5 Branch, the minor problems i had where from my own hand. So indeed like DES says, don't follow the rest like a sheep, be the black sheep, test it yourself before following the rest. Cheers!! -- Kind regards, Remko Lodder Elvandar.org/DSINet.org Www.mostly-harmless.nl Dutch Community about helping newcomers on the hackerscene From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 19 01:45:42 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B79116A4CE for ; Mon, 19 Apr 2004 01:45:42 -0700 (PDT) Received: from fwall.in.markiza.sk (fwall.in.markiza.sk [62.168.76.18]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30A7343D5F for ; Mon, 19 Apr 2004 01:45:42 -0700 (PDT) (envelope-from corwin@pleiades.aeternal.net) Received: from pleiades.aeternal.net (pleiades.in.markiza.sk [192.168.13.7]) by fwall.in.markiza.sk (Postfix) with ESMTP id 6B639230BE; Mon, 19 Apr 2004 10:45:41 +0200 (CEST) Received: from pleiades.aeternal.net (localhost [127.0.0.1]) by pleiades.aeternal.net (Postfix) with ESMTP id 13E3B1703D; Mon, 19 Apr 2004 10:46:55 +0200 (CEST) Received: (from corwin@localhost) by pleiades.aeternal.net (8.12.10/8.12.10/Submit) id i3J8ksUk095225; Mon, 19 Apr 2004 10:46:54 +0200 (CEST) (envelope-from corwin) Date: Mon, 19 Apr 2004 10:46:54 +0200 From: Martin Hudec To: Mark Message-ID: <20040419084654.GA94847@pleiades.aeternal.net> References: <200404181516.I3IFGIQ6039814@asarian-host.net> <20040419033848.GA10708@cat.robbins.dropbear.id.au> <200404190301.I3J31WIN075303@asarian-host.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404190301.I3J31WIN075303@asarian-host.net> X-Copyright: (C) 2004 Martin Hudec X-Operating-System: FreeBSD pleiades.aeternal.net 5.2.1-RELEASE-p5 i386 X-PGP-Key: http://www.aeternal.net/corwin_aeternal.asc User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: ADI AD1980 6-channel audio X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Martin Hudec List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 08:45:42 -0000 Hello Mark, For me, I use 5.2.1-RELEASE-p5 as desktop system for a month now, I haven't seen any spontaneous reboots or hangs, I just rebooted only when I had to build new world/kernel, and I never got into any problems (yes with -CURRENT it is another story :)) but that is my subjective point of view, I didn't test it on any production server to this time.. There are many advantages over 4.X branche, just to name few: UFS2, native ACLs support, usb support, yes bluetooth support, new hardware support, schedulers etc etc.. If there were really way too many problems as you say with 5.X, it wouldn't have been released as 5.X-RELEASE, would it? Those way too many problems in -question list are in great part reported from people which came straight to 5.X branch, without any experience with current production branch of 4.X. As others have mentioned in replies to your mail, do not put so much trust into what others say, but put more trust in what you have experienced, or in what you know.. That's my 10c to discussion. Cheers, Martin On Mon, Apr 19, 2004 at 03:01:59AM +0000 or thereabouts, Mark wrote: > Tim Robbins wrote: > > Because I do not trust 5.x yet. There are way, way too many problems > reported with it, daily, on the freebsd-questions list, for me to touch it > with the proverbial ten-foot pole. :) Now, if a 4.9 release came out for > amd64, that would be a different story, of course. I suspect the 32-bit > kernel will run nicely on the AMD 64 too, though. > > I would have loved to have had SATA support for the VIA chipset (not yet in > 4.9R). And if 5.x ever becomes stable (as stable as, say, my old 4.7R, which > in several years has never spontaneously reset/hung (!)), I will gladly > upgrade. > > But thanks for the encouraging glimps into the future, anyway. :) -- Martin Hudec | corwin at aeternal.net | corwin at web.markiza.sk http://www.aeternal.net | cell +421 907 303 393 From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 19 04:08:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9560616A4CE for ; Mon, 19 Apr 2004 04:08:30 -0700 (PDT) Received: from mindfields.energyhq.es.eu.org (73.Red-213-97-200.pooles.rima-tde.net [213.97.200.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B4AC43D48 for ; Mon, 19 Apr 2004 04:08:24 -0700 (PDT) (envelope-from flynn@energyhq.es.eu.org) Received: from scienide.energyhq.es.eu.org (scienide.energyhq.es.eu.org [192.168.100.1]) by mindfields.energyhq.es.eu.org (Postfix) with SMTP id 2D28236844; Mon, 19 Apr 2004 13:08:20 +0200 (CEST) Date: Mon, 19 Apr 2004 13:07:35 +0200 From: Miguel Mendez To: rodrigc@crodrigues.org Message-Id: <20040419130735.549b0979.flynn@energyhq.es.eu.org> Organization: X-Mailer: Sylpheed version 0.9.9-gtk2-20040229 (GTK+ 2.4.0; i386--netbsdelf) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9" cc: hackers@freebsd.org Subject: About the rc.conf parsing thread X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 11:08:30 -0000 --Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 7bit Craig & the rest, Just to add my $0.2 to the subject, you could have a look at the program I wrote (sysutils/thefish) which does what you mention. It has a dual interface (Gtk and libdialog) and the parser is quite good IMHO. The first iteration of the parsing backend was hand-coded, which I'd like to suggest you not to do. I rewrote the parser by moving all the lexical analysis code to a lex file. This will give you more flexibility and save time whenever you need to readjust your parser. If you don't know lex/yacc google for some tutorial, it becomes extremely useful whenever you want to parse anything but the most trivial files. Another hint, you might notice (I did) that coming up with a good enough data structure is vital for parser <-> GUI communication. I'd probably would have done it in a slightly different way now, but what I came up with works fine, feel free to take a look at that one too. The biggest part of my program is, by far, the GUI code. If you're going with GTK I'd suggest using the gtk_tree_view* set of functions, extremely useful and flexible stuff. Qt probably has a similar set of widgets. And the URI: http://www.energyhq.es.eu.org/thefish.html, it's in ports as well like I mentioned. Cheers, -- Miguel Mendez http://www.energyhq.es.eu.org PGP Key: 0xDC8514F1 --Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (NetBSD) iD8DBQFAg7L9nLctrNyFFPERAl6UAJ9y20edp8gWGNUlfECVuu9UzGXISgCeO4lk iuidVLQ0vBq0o1B+yqghh5M= =LrWJ -----END PGP SIGNATURE----- --Signature=_Mon__19_Apr_2004_13_07_35_+0200_C+vUS=HGX0Vq6go9-- From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 19 06:17:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D950316A4CE for ; Mon, 19 Apr 2004 06:17:58 -0700 (PDT) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id B95B843D4C for ; Mon, 19 Apr 2004 06:17:57 -0700 (PDT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (localhost [127.0.0.1]) (authenticated bits=0) by cain.gsoft.com.au (8.12.11/8.12.10) with ESMTP id i3JDHoSv065620; Mon, 19 Apr 2004 22:47:51 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-hackers@freebsd.org Date: Mon, 19 Apr 2004 22:47:48 +0930 User-Agent: KMail/1.6.1 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200404192247.48015.doconnor@gsoft.com.au> X-Spam-Score: -2.3 () CARRIAGE_RETURNS,SPAM_PHRASE_02_03,USER_AGENT,USER_AGENT_KMAIL X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) Subject: Detecting 'floppy' like umass devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2004 13:17:59 -0000 A friend of mine handed me a USB flash key today that has 2 'partition' - one 1.44Mb chunk pretends to be a floppy drive and the rest is a normal umass device. I am wondering if there is any way of telling if a given umass device is a floppy drive (or wants to look like one) - eg I have a USB FDD which I imagine should fall into the same basket. I note that you get wacky values from fdisk when you try and read partition table from them too.. On another note my USB floppy drive does 2k/sec in FreeBSD :( It's one of these -> Apr 19 22:45:32 inchoate kernel: umass0: NEC NEC USB UF000x, rev 1.10/1.50, addr 2 Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 0 0 0 24 0 Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): SCSI Status: Check Condition Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): UNIT ATTENTION asc:29,0 Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): Power on, reset, or bus device reset occurred Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): Retrying Command (per Sense Data) Apr 19 22:45:35 inchoate kernel: da0 at umass-sim0 bus 0 target 0 lun 0 Apr 19 22:45:35 inchoate kernel: da0: Removable Direct Access SCSI-0 device Apr 19 22:45:35 inchoate kernel: da0: 1.000MB/s transfers Apr 19 22:45:35 inchoate kernel: da0: 1MB (2880 512 byte sectors: 64H 32S/T 1C) Apr 19 22:45:36 inchoate kernel: umass0: Unsupported UFI command 0x35 Apr 19 22:45:36 inchoate kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x6, scsi status == 0x0 Apr 19 22:45:36 inchoate kernel: umass0: Unsupported UFI command 0x35 Apr 19 22:45:36 inchoate kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x6, scsi status == 0x0 I have a Dell Inspiron 8600 with a uhci0: port 0xbf80-0xbf9f irq 11 at device 29.0 on pci0 I have tried a USB flash card reader which gets ~500k/sec. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5 From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 01:20:52 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D860B16A4CE for ; Tue, 20 Apr 2004 01:20:52 -0700 (PDT) Received: from siue.dnsalias.net (student143-123.bh.siue.edu [146.163.143.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EDA843D3F for ; Tue, 20 Apr 2004 01:20:50 -0700 (PDT) (envelope-from wgrim@siue.edu) Received: from siue.edu (unknown [192.168.0.90]) by siue.dnsalias.net (Postfix) with ESMTP id E352E233D20 for ; Tue, 20 Apr 2004 03:20:49 -0500 (CDT) Message-ID: <4084DCB4.9020404@siue.edu> Date: Tue, 20 Apr 2004 03:17:56 -0500 From: "William M. Grim" Organization: SIUE User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Remote Debugging using GDB on Linux X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 08:20:53 -0000 Hi! Is it possible to do remote debugging of the FreeBSD kernel over a serial connection using Linux? FreeBSD has a special "-k" switch that Linux does not for GDB; so, I'm not even sure it's possible without a lot of work. Thanks in advance for your replies. -- William Michael Grim Student, Southern Illinois University at Edwardsville Unix Network Administrator, SIUE, Computer Science dept. Phone: (217) 341-6552 Email: wgrim@siue.edu From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 01:59:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A6B9D16A4CE for ; Tue, 20 Apr 2004 01:59:33 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id DDD0043D31 for ; Tue, 20 Apr 2004 01:59:32 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) i3K8xLPo052295 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 20 Apr 2004 10:59:24 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id i3K8w9hn034920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Apr 2004 10:58:10 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id i3K8w9FM003354; Tue, 20 Apr 2004 10:58:09 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i3K8w6t1003353; Tue, 20 Apr 2004 10:58:06 +0200 (CEST) (envelope-from ticso) Date: Tue, 20 Apr 2004 10:58:05 +0200 From: Bernd Walter To: "Daniel O'Connor" Message-ID: <20040420085805.GA5279@cicely12.cicely.de> References: <200404192247.48015.doconnor@gsoft.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404192247.48015.doconnor@gsoft.com.au> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.63 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on cicely12.cicely.de cc: freebsd-hackers@freebsd.org Subject: Re: Detecting 'floppy' like umass devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 08:59:33 -0000 On Mon, Apr 19, 2004 at 10:47:48PM +0930, Daniel O'Connor wrote: > A friend of mine handed me a USB flash key today that has 2 'partition' - one > 1.44Mb chunk pretends to be a floppy drive and the rest is a normal umass > device. > > I am wondering if there is any way of telling if a given umass device is > a floppy drive (or wants to look like one) - eg I have a USB FDD which > I imagine should fall into the same basket. What do do you mean with "wants to look like one". In which way does a floppy look different from other direct access drives? They all read and store direct access data. > I note that you get wacky values from fdisk when you try and read partition > table from them too.. > > On another note my USB floppy drive does 2k/sec in FreeBSD :( Sound like another instance of msdosfs does no clustering and drive is too stupid to get speed without. IIRC there were some work on this point, but I don't now the state. Check the speed with dd and different blocksizes. > It's one of these -> > Apr 19 22:45:32 inchoate kernel: umass0: NEC NEC USB UF000x, rev 1.10/1.50, addr 2 > Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): INQUIRY. CDB: 12 0 0 0 24 0 > Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): CAM Status: SCSI Status Error > Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): SCSI Status: Check Condition > Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): UNIT ATTENTION asc:29,0 > Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): Power on, reset, or bus device reset occurred > Apr 19 22:45:33 inchoate kernel: (probe0:umass-sim0:0:0:0): Retrying Command (per Sense Data) > Apr 19 22:45:35 inchoate kernel: da0 at umass-sim0 bus 0 target 0 lun 0 > Apr 19 22:45:35 inchoate kernel: da0: Removable Direct Access SCSI-0 device > Apr 19 22:45:35 inchoate kernel: da0: 1.000MB/s transfers > Apr 19 22:45:35 inchoate kernel: da0: 1MB (2880 512 byte sectors: 64H 32S/T 1C) > Apr 19 22:45:36 inchoate kernel: umass0: Unsupported UFI command 0x35 > Apr 19 22:45:36 inchoate kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x6, scsi status == 0x0 > Apr 19 22:45:36 inchoate kernel: umass0: Unsupported UFI command 0x35 > Apr 19 22:45:36 inchoate kernel: (da0:umass-sim0:0:0:0): Synchronize cache failed, status == 0x6, scsi status == 0x0 Nothing wrong with those messages. > I have a Dell Inspiron 8600 with a > uhci0: port 0xbf80-0xbf9f irq 11 at device 29.0 on pci0 > > I have tried a USB flash card reader which gets ~500k/sec. If a drive doesn't preread blocks then each access has to wait for the media - undoubly flash has a faster access time than floppies... -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 02:20:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D42C416A4D0; Tue, 20 Apr 2004 02:20:48 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EE3343D2D; Tue, 20 Apr 2004 02:20:48 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i3K9KbE5014523; Tue, 20 Apr 2004 11:20:43 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: "Christian S.J. Peron" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 20 Apr 2004 01:56:38 -0000." <20040420015638.A84821@staff.seccuris.com> Date: Tue, 20 Apr 2004 11:20:37 +0200 Message-ID: <14522.1082452837@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org cc: freebsd-security@freebsd.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 09:20:49 -0000 In message <20040420015638.A84821@staff.seccuris.com>, "Christian S.J. Peron" w rites: > > Although RAW sockets can be used when specifying the source > address of packets (defeating one of the aspects of the jail) > some people may find it usefull to use utilities like ping(8) > or traceroute(8) from inside jails. > > Enclosed is a patch I have written which gives you the option > of allowing prison-root to create raw sockets inside the prison, > so that programs various network debugging programs like ping > and traceroute etc can be used. > > This patch will create the security.jail.allow_raw_sockets sysctl > MIB. I would appriciate any feed-back from testers > > See PR #: > http://www.freebsd.org/cgi/query-pr.cgi?pr=65800 Could you take a peek and see how hard it would be to enforce source-IP compliance with the jail restriction ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 19 18:56:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F81A16A4CE for ; Mon, 19 Apr 2004 18:56:39 -0700 (PDT) Received: from staff.seccuris.com (staff.seccuris.com [204.112.0.40]) by mx1.FreeBSD.org (Postfix) with SMTP id BF45843D41 for ; Mon, 19 Apr 2004 18:56:38 -0700 (PDT) (envelope-from maneo@bsdpro.com) Received: (qmail 85734 invoked by uid 1006); 20 Apr 2004 01:56:38 -0000 Date: Tue, 20 Apr 2004 01:56:38 +0000 From: "Christian S.J. Peron" To: freebsd-hackers@FreeBSD.org Message-ID: <20040420015638.A84821@staff.seccuris.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Mailman-Approved-At: Tue, 20 Apr 2004 05:11:02 -0700 cc: freebsd-security@FreeBSD.org Subject: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 01:56:39 -0000 Although RAW sockets can be used when specifying the source address of packets (defeating one of the aspects of the jail) some people may find it usefull to use utilities like ping(8) or traceroute(8) from inside jails. Enclosed is a patch I have written which gives you the option of allowing prison-root to create raw sockets inside the prison, so that programs various network debugging programs like ping and traceroute etc can be used. This patch will create the security.jail.allow_raw_sockets sysctl MIB. I would appriciate any feed-back from testers See PR #: http://www.freebsd.org/cgi/query-pr.cgi?pr=65800 -------------------- SNIP SNIP ------------------------ --- sys/kern/kern_jail.c.bak Mon Apr 19 16:55:40 2004 +++ sys/kern/kern_jail.c Mon Apr 19 17:56:03 2004 @@ -53,6 +53,11 @@ &jail_sysvipc_allowed, 0, "Processes in jail can use System V IPC primitives"); +int jail_allow_raw_sockets = 0; +SYSCTL_INT(_security_jail, OID_AUTO, allow_raw_sockets, CTLFLAG_RW, + &jail_allow_raw_sockets, 0, + "Prison root can create raw sockets"); + /* allprison, lastprid, and prisoncount are protected by allprison_mtx. */ struct prisonlist allprison; struct mtx allprison_mtx; --- sys/netinet/raw_ip.c.b Mon Apr 19 16:23:57 2004 +++ sys/netinet/raw_ip.c Mon Apr 19 17:55:08 2004 @@ -40,6 +40,7 @@ #include "opt_random_ip_id.h" #include +#include #include #include #include @@ -505,6 +506,7 @@ } } +extern int jail_allow_raw_sockets; u_long rip_sendspace = RIPSNDQ; u_long rip_recvspace = RIPRCVQ; @@ -527,7 +529,11 @@ INP_INFO_WUNLOCK(&ripcbinfo); return EINVAL; } - if (td && (error = suser(td)) != 0) { + if (td && jailed(td->td_ucred) && !jail_allow_raw_sockets) { + INP_INFO_WUNLOCK(&ripcbinfo); + return (EPERM); + } + if (td && (error = suser_cred(td->td_ucred, PRISON_ROOT)) != 0) { INP_INFO_WUNLOCK(&ripcbinfo); return error; } From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 08:23:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CECCF16A4CE for ; Tue, 20 Apr 2004 08:23:33 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A5F343D54 for ; Tue, 20 Apr 2004 08:23:33 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by ns1.xcllnt.net (8.12.11/8.12.11) with ESMTP id i3KFNXti095039; Tue, 20 Apr 2004 08:23:33 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) i3KFNXQx004283; Tue, 20 Apr 2004 08:23:33 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.11/8.12.11/Submit) id i3KFNTDA004282; Tue, 20 Apr 2004 08:23:29 -0700 (PDT) (envelope-from marcel) Date: Tue, 20 Apr 2004 08:23:29 -0700 From: Marcel Moolenaar To: "William M. Grim" Message-ID: <20040420152329.GA4238@dhcp01.pn.xcllnt.net> References: <4084DCB4.9020404@siue.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4084DCB4.9020404@siue.edu> User-Agent: Mutt/1.4.2.1i cc: hackers@freebsd.org Subject: Re: Remote Debugging using GDB on Linux X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 15:23:33 -0000 On Tue, Apr 20, 2004 at 03:17:56AM -0500, William M. Grim wrote: > Hi! > > Is it possible to do remote debugging of the FreeBSD kernel over a > serial connection using Linux? FreeBSD has a special "-k" switch that > Linux does not for GDB; so, I'm not even sure it's possible without a > lot of work. Most of the logic is in the gdb stub, which lives in the kernel. You don't have to use -k to be able to remote debug the kernel. It may have to be a cross-debugger (host=*-*-linux*, target=*-*-freebsd*). In principle it should not be necessary, provided the host and target architectures are the same. In short: try it. chances are it works. If not, try with a cross-gdb. HTH, -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 13:24:45 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C6FB16A4DA; Tue, 20 Apr 2004 13:24:45 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9AD7943D5D; Tue, 20 Apr 2004 13:24:44 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.11/8.12.11) with ESMTP id i3KKOcoc023454; Tue, 20 Apr 2004 22:24:39 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: "Christian S.J. Peron" From: "Poul-Henning Kamp" In-Reply-To: Your message of "Tue, 20 Apr 2004 20:00:27 -0000." <20040420200027.A51891@staff.seccuris.com> Date: Tue, 20 Apr 2004 22:24:38 +0200 Message-ID: <23453.1082492678@critter.freebsd.dk> cc: freebsd-hackers@freebsd.org cc: freebsd-security@freebsd.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 20:24:45 -0000 In message <20040420200027.A51891@staff.seccuris.com>, "Christian S.J. Peron" w rites: >Poul/group > >The following patch makes raw sockets comply with prison IP addresses. >Some tools such as traceroute(8) may require that the prison IP address >be specified on the command line. I.E. > > traceroute -s > >Otherwise it might fail. How does traceroute and ping normally determine which source address to use ? Can't we use that mechanism to default them to the right thing ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 13:37:24 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 49F5816A4CE for ; Tue, 20 Apr 2004 13:37:24 -0700 (PDT) Received: from siue.dnsalias.net (student143-123.bh.siue.edu [146.163.143.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id 161E743D39 for ; Tue, 20 Apr 2004 13:37:24 -0700 (PDT) (envelope-from wgrim@siue.edu) Received: from siue.edu (unknown [192.168.0.90]) by siue.dnsalias.net (Postfix) with ESMTP id 73468234676; Tue, 20 Apr 2004 15:37:23 -0500 (CDT) Message-ID: <4085895D.2020109@siue.edu> Date: Tue, 20 Apr 2004 15:34:37 -0500 From: "William M. Grim" Organization: SIUE User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031107 Debian/1.5-3 X-Accept-Language: en MIME-Version: 1.0 To: Marcel Moolenaar References: <4084DCB4.9020404@siue.edu> <20040420152329.GA4238@dhcp01.pn.xcllnt.net> In-Reply-To: <20040420152329.GA4238@dhcp01.pn.xcllnt.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: hackers@freebsd.org Subject: Re: Remote Debugging using GDB on Linux X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 20:37:24 -0000 Marcel Moolenaar wrote: >On Tue, Apr 20, 2004 at 03:17:56AM -0500, William M. Grim wrote: > > >>Hi! >> >>Is it possible to do remote debugging of the FreeBSD kernel over a >>serial connection using Linux? FreeBSD has a special "-k" switch that >>Linux does not for GDB; so, I'm not even sure it's possible without a >>lot of work. >> >> > >Most of the logic is in the gdb stub, which lives in the kernel. You >don't have to use -k to be able to remote debug the kernel. It may >have to be a cross-debugger (host=*-*-linux*, target=*-*-freebsd*). >In principle it should not be necessary, provided the host and target >architectures are the same. > >In short: try it. chances are it works. If not, try with a cross-gdb. > >HTH, > > > No problem. Once my serial cable gets here I will try it. Thanks. -- William Michael Grim Student, Southern Illinois University at Edwardsville Unix Network Administrator, SIUE, Computer Science dept. Phone: (217) 341-6552 Email: wgrim@siue.edu From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 13:44:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4F12B16A4CE for ; Tue, 20 Apr 2004 13:44:54 -0700 (PDT) Received: from creme-brulee.marcuscom.com (rrcs-midsouth-24-172-16-118.biz.rr.com [24.172.16.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id C872A43D1D for ; Tue, 20 Apr 2004 13:44:53 -0700 (PDT) (envelope-from marcus@FreeBSD.org) Received: from [10.2.1.4] (vpn-client-4.marcuscom.com [10.2.1.4]) i3KKhrPb094529 for ; Tue, 20 Apr 2004 16:43:53 -0400 (EDT) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: freebsd-hackers@FreeBSD.org Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-EllP4eIeltJcC0f5zfCY" Organization: FreeBSD, Inc. Message-Id: <1082493900.837.79.camel@gyros> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 20 Apr 2004 16:45:00 -0400 X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on creme-brulee.marcuscom.com Subject: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 20:44:54 -0000 --=-EllP4eIeltJcC0f5zfCY Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I have a problem I'm hoping someone can help me with. GTK+ 2.4 introduced a new file selection GUI which works just fine in threaded and non-threaded applications. However, GNOME 2.6 augmented this dialog with a dynamically loadable threaded shared object. The GNOME version is automatically used by all GTK+ apps when run under a GNOME desktop if libgnomeui is installed. When this object is dynamically loaded into GNOME applications, they work just fine as they are linked to a thread library. However, when a GTK+ non-threaded app tries to load this object, I get a segmentation fault because the pthread_cond_wait() symbol gets found in libc before the thread library, and threaded locking isn't setup. I've tried a lot of things to try and fix this. I tried using dlopen/dlsym to resolve pthread_cond_wait from the thread library, but this doesn't work. I tried setting __isthreaded to 1, but that didn't work (it gets overridden). The only thing that works is to set LD_PRELOAD to the thread library before running the non-threaded app (or fixing the app to link against PTHREAD_LIBS). Is there a better solution to this? This problem only seems to affect 5.X. I'm hoping not to have to link every GTK+ app that might use the new file selector to PTHREAD_LIBS. Any advice would be greatly appreciated. Thanks. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: marcus@FreeBSD.org gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-EllP4eIeltJcC0f5zfCY Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhYvMb2iPiv4Uz4cRAiCOAKCVApHEGtZOZ6Kcauj9UanrqP/QnQCdEFIT Gd5hJgXBRNXr2RI4b5VnoTI= =Znrg -----END PGP SIGNATURE----- --=-EllP4eIeltJcC0f5zfCY-- From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 14:08:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E822F16A4CE; Tue, 20 Apr 2004 14:08:39 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 438FB43D39; Tue, 20 Apr 2004 14:08:39 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i3KL8ctf019130; Tue, 20 Apr 2004 17:08:38 -0400 (EDT) Date: Tue, 20 Apr 2004 17:08:38 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Joe Marcus Clarke In-Reply-To: <1082493900.837.79.camel@gyros> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 21:08:40 -0000 On Tue, 20 Apr 2004, Joe Marcus Clarke wrote: > I have a problem I'm hoping someone can help me with. GTK+ 2.4 > introduced a new file selection GUI which works just fine in threaded > and non-threaded applications. However, GNOME 2.6 augmented this dialog > with a dynamically loadable threaded shared object. The GNOME version > is automatically used by all GTK+ apps when run under a GNOME desktop if > libgnomeui is installed. Shared libraries shouldn't link with threading libraries unless they actually create threads behind the scenes. Actually, even so, they could force the (unthreaded) applications that link with them to explicitly supply the thread library in the link option. > When this object is dynamically loaded into GNOME applications, they work > just fine as they are linked to a thread library. However, when a GTK+ > non-threaded app tries to load this object, I get a segmentation fault > because the pthread_cond_wait() symbol gets found in libc before the thread > library, and threaded locking isn't setup. I've tried a lot of things to > try and fix this. I tried using dlopen/dlsym to resolve pthread_cond_wait > from the thread library, but this doesn't work. I tried setting > __isthreaded to 1, but that didn't work (it gets overridden). The only > thing that works is to set LD_PRELOAD to the thread library before running > the non-threaded app (or fixing the app to link against PTHREAD_LIBS). > > Is there a better solution to this? This problem only seems to affect > 5.X. I'm hoping not to have to link every GTK+ app that might use the > new file selector to PTHREAD_LIBS. Any advice would be greatly > appreciated. Thanks. Try using -pthread to build the shared library instead of -lpthread. That will avoid the link to libpthread. If it's only locking that the library needs, libc should have all the necessary stubs. An alternative is to get GNOME maintainers to use a thread stub library and have their shared libraries link to that. The stub library would provide weak locking symbols and be overridden by applications bringing in real thread libraries. Perhaps something like that could work. -- Dan Eischen From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 16:09:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92CC616A4CE; Tue, 20 Apr 2004 16:09:08 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id B03BB43D41; Tue, 20 Apr 2004 16:09:07 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004042023090101500rm0hle>; Tue, 20 Apr 2004 23:09:07 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA21014; Tue, 20 Apr 2004 16:09:00 -0700 (PDT) Date: Tue, 20 Apr 2004 16:08:59 -0700 (PDT) From: Julian Elischer To: "Christian S.J. Peron" In-Reply-To: <20040420015638.A84821@staff.seccuris.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@FreeBSD.org cc: freebsd-security@FreeBSD.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 23:09:08 -0000 hooray! Jails are used for a lot mor ethan just security stuff.. We use them for enviromment isolation. Security to us is just a minor point.. If I could I'd like to be able to turn off: blocking of raw sockets. blocking of chflags. only problem is I'd need it against 4.x.. (I guess I can manage that....) On Tue, 20 Apr 2004, Christian S.J. Peron wrote: > > Although RAW sockets can be used when specifying the source > address of packets (defeating one of the aspects of the jail) > some people may find it usefull to use utilities like ping(8) > or traceroute(8) from inside jails. > > Enclosed is a patch I have written which gives you the option > of allowing prison-root to create raw sockets inside the prison, > so that programs various network debugging programs like ping > and traceroute etc can be used. > > This patch will create the security.jail.allow_raw_sockets sysctl > MIB. I would appriciate any feed-back from testers > > See PR #: > http://www.freebsd.org/cgi/query-pr.cgi?pr=65800 > > -------------------- SNIP SNIP ------------------------ > > --- sys/kern/kern_jail.c.bak Mon Apr 19 16:55:40 2004 > +++ sys/kern/kern_jail.c Mon Apr 19 17:56:03 2004 > @@ -53,6 +53,11 @@ > &jail_sysvipc_allowed, 0, > "Processes in jail can use System V IPC primitives"); > > +int jail_allow_raw_sockets = 0; > +SYSCTL_INT(_security_jail, OID_AUTO, allow_raw_sockets, CTLFLAG_RW, > + &jail_allow_raw_sockets, 0, > + "Prison root can create raw sockets"); > + > /* allprison, lastprid, and prisoncount are protected by allprison_mtx. */ > struct prisonlist allprison; > struct mtx allprison_mtx; > --- sys/netinet/raw_ip.c.b Mon Apr 19 16:23:57 2004 > +++ sys/netinet/raw_ip.c Mon Apr 19 17:55:08 2004 > @@ -40,6 +40,7 @@ > #include "opt_random_ip_id.h" > > #include > +#include > #include > #include > #include > @@ -505,6 +506,7 @@ > } > } > > +extern int jail_allow_raw_sockets; > u_long rip_sendspace = RIPSNDQ; > u_long rip_recvspace = RIPRCVQ; > > @@ -527,7 +529,11 @@ > INP_INFO_WUNLOCK(&ripcbinfo); > return EINVAL; > } > - if (td && (error = suser(td)) != 0) { > + if (td && jailed(td->td_ucred) && !jail_allow_raw_sockets) { > + INP_INFO_WUNLOCK(&ripcbinfo); > + return (EPERM); > + } > + if (td && (error = suser_cred(td->td_ucred, PRISON_ROOT)) != 0) { > INP_INFO_WUNLOCK(&ripcbinfo); > return error; > } > _______________________________________________ > freebsd-security@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-security > To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 16:10:21 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 247D516A4CE; Tue, 20 Apr 2004 16:10:21 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0E2143D1D; Tue, 20 Apr 2004 16:10:20 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc12) with ESMTP id <2004042023100901400r8vrve>; Tue, 20 Apr 2004 23:10:20 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA21078; Tue, 20 Apr 2004 16:10:09 -0700 (PDT) Date: Tue, 20 Apr 2004 16:10:06 -0700 (PDT) From: Julian Elischer To: Poul-Henning Kamp In-Reply-To: <14522.1082452837@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-security@freebsd.org cc: "Christian S.J. Peron" cc: freebsd-hackers@freebsd.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 23:10:21 -0000 On Tue, 20 Apr 2004, Poul-Henning Kamp wrote: > In message <20040420015638.A84821@staff.seccuris.com>, "Christian S.J. Peron" w > rites: > > [...] > > See PR #: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=65800 > > Could you take a peek and see how hard it would be to enforce source-IP > compliance with the jail restriction ? Good idea. From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 17:09:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D670016A4CE for ; Tue, 20 Apr 2004 17:09:35 -0700 (PDT) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84AFF43D41 for ; Tue, 20 Apr 2004 17:09:35 -0700 (PDT) (envelope-from grog@lemis.com) Received: from blackwater.lemis.com (blackwater.lemis.com [192.109.197.80]) by ozlabs.org (Postfix) with ESMTP id E54022BD85 for ; Wed, 21 Apr 2004 10:09:32 +1000 (EST) Received: by blackwater.lemis.com (Postfix, from userid 1004) id 4C93551224; Wed, 21 Apr 2004 09:39:30 +0930 (CST) Date: Wed, 21 Apr 2004 09:39:30 +0930 From: Greg 'groggy' Lehey To: "William M. Grim" Message-ID: <20040421000930.GC76172@wantadilla.lemis.com> References: <4084DCB4.9020404@siue.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="i7F3eY7HS/tUJxUd" Content-Disposition: inline In-Reply-To: <4084DCB4.9020404@siue.edu> User-Agent: Mutt/1.4.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: hackers@freebsd.org Subject: Re: Remote Debugging using GDB on Linux X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 00:09:35 -0000 --i7F3eY7HS/tUJxUd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 20 April 2004 at 3:17:56 -0500, William M. Grim wrote: > Hi! > > Is it possible to do remote debugging of the FreeBSD kernel over a > serial connection using Linux? FreeBSD has a special "-k" switch that > Linux does not for GDB; so, I'm not even sure it's possible without a > lot of work. I haven't tried it that way round, but I have debugged a Linux kernel over a serial line with FreeBSD gdb. That suggests that it might work the other way round, too. Unfortunately, my experience with NetBSD doesn't bear this out: I can debug a NetBSD kernel with FreeBSD gdb, but not the other way round. Greg -- Note: I discard all HTML mail unseen. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. --i7F3eY7HS/tUJxUd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQFAhbu6IubykFB6QiMRAqnTAJ9Y3L+dufJyEzWAhyiQVkOndHmxVgCfYAKd hb93y4pIquUkCiqFmm34c5g= =lWPd -----END PGP SIGNATURE----- --i7F3eY7HS/tUJxUd-- From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 21:00:31 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 11E0E16A51E for ; Tue, 20 Apr 2004 21:00:31 -0700 (PDT) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7DF5743D39 for ; Tue, 20 Apr 2004 21:00:29 -0700 (PDT) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (localhost [127.0.0.1]) (authenticated bits=0) by cain.gsoft.com.au (8.12.11/8.12.10) with ESMTP id i3L401ib029385; Wed, 21 Apr 2004 13:30:02 +0930 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: ticso@cicely.de Date: Wed, 21 Apr 2004 13:29:29 +0930 User-Agent: KMail/1.6.1 References: <200404192247.48015.doconnor@gsoft.com.au> <20040420085805.GA5279@cicely12.cicely.de> In-Reply-To: <20040420085805.GA5279@cicely12.cicely.de> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200404211329.29681.doconnor@gsoft.com.au> X-Spam-Score: -4.1 () CARRIAGE_RETURNS,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_03_05,USER_AGENT,USER_AGENT_KMAIL X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) cc: freebsd-hackers@freebsd.org Subject: Re: Detecting 'floppy' like umass devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 04:00:31 -0000 On Tue, 20 Apr 2004 18:28, Bernd Walter wrote: > > I am wondering if there is any way of telling if a given umass device is > > a floppy drive (or wants to look like one) - eg I have a USB FDD which > > I imagine should fall into the same basket. > > What do do you mean with "wants to look like one". > In which way does a floppy look different from other direct access > drives? > They all read and store direct access data. Partially to handle things like fdformat, and density selection, but also from a user point of view, ie it would be nice if it appeared as /dev/fdX. IMHO it's not obvious (and dangerous) to tell mtools that a: = /dev/da0 but that's what I have to do if I want to use my USB FDD with it. > > I note that you get wacky values from fdisk when you try and read > > partition table from them too.. > > > > On another note my USB floppy drive does 2k/sec in FreeBSD :( > > Sound like another instance of msdosfs does no clustering and drive > is too stupid to get speed without. > IIRC there were some work on this point, but I don't now the state. > Check the speed with dd and different blocksizes. This IS with dd :) I did a few tests.. Block Size | Speed ===========+=========== 0.5k | 2.2k/sec 1 k | 4.4k/sec 2 k | 8.0k/sec 4 k | 12.6k/sec 8 k | 17.7k/sec 16 k | 21.8k/sec 32 k | 23.9k/sec 64 k | 26.2k/sec Bleh :( > > I have a Dell Inspiron 8600 with a > > uhci0: port 0xbf80-0xbf9f irq > > 11 at device 29.0 on pci0 > > > > I have tried a USB flash card reader which gets ~500k/sec. > > If a drive doesn't preread blocks then each access has to wait for the > media - undoubly flash has a faster access time than floppies... Yeah, I just meant that "it's not my USB port" :) -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5 From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 22:22:28 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BC6416A4CE for ; Tue, 20 Apr 2004 22:22:28 -0700 (PDT) Received: from creme-brulee.marcuscom.com (rrcs-midsouth-24-172-16-118.biz.rr.com [24.172.16.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C09A43D66 for ; Tue, 20 Apr 2004 22:22:27 -0700 (PDT) (envelope-from marcus@FreeBSD.org) Received: from [192.168.1.4] (shumai.marcuscom.com [192.168.1.4]) i3L5LP1U097663; Wed, 21 Apr 2004 01:21:25 -0400 (EDT) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Daniel Eischen In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-akjjKJEg+CZ8tCZxwMlk" Organization: FreeBSD, Inc. Message-Id: <1082524938.41182.26.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 21 Apr 2004 01:22:18 -0400 cc: freebsd-hackers@FreeBSD.org Subject: Re: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 05:22:28 -0000 --=-akjjKJEg+CZ8tCZxwMlk Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2004-04-20 at 17:08, Daniel Eischen wrote: > On Tue, 20 Apr 2004, Joe Marcus Clarke wrote: >=20 > > I have a problem I'm hoping someone can help me with. GTK+ 2.4 > > introduced a new file selection GUI which works just fine in threaded > > and non-threaded applications. However, GNOME 2.6 augmented this dialo= g > > with a dynamically loadable threaded shared object. The GNOME version > > is automatically used by all GTK+ apps when run under a GNOME desktop i= f > > libgnomeui is installed. >=20 > Shared libraries shouldn't link with threading libraries > unless they actually create threads behind the scenes. > Actually, even so, they could force the (unthreaded) > applications that link with them to explicitly supply > the thread library in the link option. And that's the case here. The underlying libraries are creating and using threads. But what happens when a non-threaded application loads a thread library via dlopen() (which is the case here)? Here's the stack trace I see: #1 0x28b474b5 in _spinlock_debug () from /usr/lib/libc_r.so.5 No symbol table info available. #2 0x28b4c873 in _mutex_cv_lock () from /usr/lib/libc_r.so.5 No symbol table info available. #3 0x28b4c738 in _mutex_cv_unlock () from /usr/lib/libc_r.so.5 No symbol table info available. #4 0x28b50e50 in _pthread_cond_wait () from /usr/lib/libc_r.so.5 No symbol table info available. #5 0x28b50fa0 in pthread_cond_wait () from /usr/lib/libc_r.so.5 No symbol table info available. #6 0x288af4e3 in pthread_cond_wait () from /lib/libc.so.5 No symbol table info available. #7 0x28a00262 in giop_recv_buffer_get (ent=3D0xbfbfd9d0) at giop-recv-buffer.c:707 tdata =3D (GIOPThread *) 0x8090320 ... Under normal circumstances, this application doesn't need to be linked to PTHREAD_LIBS. However, for this one option (--file-selection in this case), a threaded module is dlopen()'d, and this happens. [snip] > Try using -pthread to build the shared library instead of > -lpthread. That will avoid the link to libpthread. If > it's only locking that the library needs, libc should have > all the necessary stubs. It's more than just locking. Threads are being created. If I go with -pthread, I'd have to relink every GNOME application, and I'm trying to avoid that if possible. Joe >=20 > An alternative is to get GNOME maintainers to use a thread > stub library and have their shared libraries link to that. > The stub library would provide weak locking symbols and > be overridden by applications bringing in real thread > libraries. Perhaps something like that could work. --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-akjjKJEg+CZ8tCZxwMlk Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhgUJb2iPiv4Uz4cRAnlEAJ44ASsdlSyM3YMHH0P7jM8wU2a5EgCbBbaX hX4yziGiOc1Po7xKaSi1syE= =Pnq2 -----END PGP SIGNATURE----- --=-akjjKJEg+CZ8tCZxwMlk-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 01:20:17 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2691516A4CE for ; Wed, 21 Apr 2004 01:20:17 -0700 (PDT) Received: from smtp.dkm.cz (smtp.dkm.cz [62.24.64.34]) by mx1.FreeBSD.org (Postfix) with SMTP id D5A0543D49 for ; Wed, 21 Apr 2004 01:20:15 -0700 (PDT) (envelope-from neuhauser@chello.cz) Received: (qmail 75227 invoked by uid 0); 21 Apr 2004 08:20:14 -0000 Received: from r3al16.mistral.cz (HELO isis.wad.cz) (213.220.229.16) by smtp.dkm.cz with SMTP; 21 Apr 2004 08:20:14 -0000 Received: by isis.wad.cz (Postfix, from userid 1001) id 2525D2FDA01; Wed, 21 Apr 2004 10:20:14 +0200 (CEST) Date: Wed, 21 Apr 2004 10:20:14 +0200 From: Roman Neuhauser To: Kris Kennaway Message-ID: <20040421082013.GA650@isis.wad.cz> Mail-Followup-To: Kris Kennaway , freebsd-hackers , markm@freebsd.org References: <20040405003553.GG27087@isis.wad.cz> <20040405020207.GA44906@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040405020207.GA44906@xor.obsecurity.org> User-Agent: Mutt/1.5.6i cc: freebsd-hackers Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 08:20:17 -0000 # kris@obsecurity.org / 2004-04-04 19:02:07 -0700: > On Mon, Apr 05, 2004 at 02:35:53AM +0200, Roman Neuhauser wrote: > > Booting a kernel with random compiled in, and load_random=YES in > > loader.conf causes a panic very similar to the one described here: > > http://lists.freebsd.org/pipermail/freebsd-alpha/2003-August/000656.html > > > > "Hi Mark, please fix random.ko" :-) > > Sounds like a generic module problem that is known to exist on > FreeBSD. "Don't do that" is the solution. > > You can unload the preloaded kernel and/or modules from the loader to > prevent it from panicking at boot, then modify loader.conf. The fun part (and reason I asked whether there was a way to tell loader to ignore loader.con) was that "unload" didn't help, it showed the kernel and modules were unloaded, but subsequent load boot or boot loaded the the modules again, and I had to "disable-module" for every individual module, about twelve times. Is that normal behavior, or was there a pilot error somewhere? -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 01:25:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A7EFC16A4CE; Wed, 21 Apr 2004 01:25:06 -0700 (PDT) Received: from mtaw6.prodigy.net (mtaw6.prodigy.net [64.164.98.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CB6443D3F; Wed, 21 Apr 2004 01:25:06 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: from obsecurity.dyndns.org (45580ed925f661040ef1621d9e7fb155@adsl-67-115-73-128.dsl.lsan03.pacbell.net [67.115.73.128]) by mtaw6.prodigy.net (8.12.10/8.12.10) with ESMTP id i3L8NspT007286; Wed, 21 Apr 2004 01:23:55 -0700 (PDT) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 7A75353097; Wed, 21 Apr 2004 01:25:05 -0700 (PDT) Date: Wed, 21 Apr 2004 01:25:05 -0700 From: Kris Kennaway To: Kris Kennaway , freebsd-hackers , markm@freebsd.org Message-ID: <20040421082505.GA75715@xor.obsecurity.org> References: <20040405003553.GG27087@isis.wad.cz> <20040405020207.GA44906@xor.obsecurity.org> <20040421082013.GA650@isis.wad.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: <20040421082013.GA650@isis.wad.cz> User-Agent: Mutt/1.4.2.1i Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 08:25:06 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 21, 2004 at 10:20:14AM +0200, Roman Neuhauser wrote: > # kris@obsecurity.org / 2004-04-04 19:02:07 -0700: > > On Mon, Apr 05, 2004 at 02:35:53AM +0200, Roman Neuhauser wrote: > > > Booting a kernel with random compiled in, and load_random=3DYES in > > > loader.conf causes a panic very similar to the one described here: > > > http://lists.freebsd.org/pipermail/freebsd-alpha/2003-August/000656.h= tml > > >=20 > > > "Hi Mark, please fix random.ko" :-) > >=20 > > Sounds like a generic module problem that is known to exist on > > FreeBSD. "Don't do that" is the solution. > >=20 > > You can unload the preloaded kernel and/or modules from the loader to > > prevent it from panicking at boot, then modify loader.conf. >=20 > The fun part (and reason I asked whether there was a way to tell > loader to ignore loader.con) was that "unload" didn't help, it > showed the kernel and modules were unloaded, but subsequent > =20 > load > boot >=20 > or >=20 > boot >=20 > loaded the the modules again, and I had to "disable-module" for > every individual module, about twelve times. Is that normal > behavior, or was there a pilot error somewhere? I think it's expected behaviour. My fingers know what to do to stop this, but my brain can't remember it right now :-) Kris --17pEHd4RhPHOinZp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAhi/eWry0BWjoQKURAkT8AJ0Xet03/Dh+fND/+V5fToGeYJKRwQCeIjHs uHNP7laDmXqJwCg40BMD6Qc= =Uqfw -----END PGP SIGNATURE----- --17pEHd4RhPHOinZp-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 02:54:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EAA016A4CE for ; Wed, 21 Apr 2004 02:54:54 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id A326B43D5D for ; Wed, 21 Apr 2004 02:54:53 -0700 (PDT) (envelope-from ticso@cicely12.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) (authenticated bits=0) i3L9sYPo022246 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Wed, 21 Apr 2004 11:54:38 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (cicely12.cicely.de [IPv6:3ffe:400:8d0:301::12]) by cicely5.cicely.de (8.12.10/8.12.10) with ESMTP id i3L9rqhn043943 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 21 Apr 2004 11:53:52 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: from cicely12.cicely.de (localhost [127.0.0.1]) by cicely12.cicely.de (8.12.11/8.12.11) with ESMTP id i3L9rpWN011532; Wed, 21 Apr 2004 11:53:51 +0200 (CEST) (envelope-from ticso@cicely12.cicely.de) Received: (from ticso@localhost) by cicely12.cicely.de (8.12.11/8.12.11/Submit) id i3L9rmU7011531; Wed, 21 Apr 2004 11:53:48 +0200 (CEST) (envelope-from ticso) Date: Wed, 21 Apr 2004 11:53:48 +0200 From: Bernd Walter To: "Daniel O'Connor" Message-ID: <20040421095347.GP5279@cicely12.cicely.de> References: <200404192247.48015.doconnor@gsoft.com.au> <20040420085805.GA5279@cicely12.cicely.de> <200404211329.29681.doconnor@gsoft.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404211329.29681.doconnor@gsoft.com.au> X-Operating-System: FreeBSD cicely12.cicely.de 5.2-CURRENT alpha User-Agent: Mutt/1.5.6i X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham version=2.61 X-Spam-Report: * -4.9 BAYES_00 BODY: Bayesian spam probability is 0 to 1% * [score: 0.0000] X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on cicely5.cicely.de cc: freebsd-hackers@freebsd.org cc: ticso@cicely.de Subject: Re: Detecting 'floppy' like umass devices X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ticso@cicely.de List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 09:54:54 -0000 On Wed, Apr 21, 2004 at 01:29:29PM +0930, Daniel O'Connor wrote: > On Tue, 20 Apr 2004 18:28, Bernd Walter wrote: > > > I am wondering if there is any way of telling if a given umass device is > > > a floppy drive (or wants to look like one) - eg I have a USB FDD which > > > I imagine should fall into the same basket. > > > > What do do you mean with "wants to look like one". > > In which way does a floppy look different from other direct access > > drives? > > They all read and store direct access data. > > Partially to handle things like fdformat, and density selection, but also from > a user point of view, ie it would be nice if it appeared as /dev/fdX. camcontrol format? OK - density has to be configured raw. Do USB floppies support different formats anyway? > IMHO it's not obvious (and dangerous) to tell mtools that a: = /dev/da0 but > that's what I have to do if I want to use my USB FDD with it. That's what I have to face with my MO drives since years. And it's the same story that you can overwrite the wrong streamer tape, ... The real point that is missing here is working hardwiring of USB mass storage devices. Plus I never liked ad0 vs. da0 problematic - typos can me made too quick. But that's the way is is: You are root. > > > I note that you get wacky values from fdisk when you try and read > > > partition table from them too.. > > > > > > On another note my USB floppy drive does 2k/sec in FreeBSD :( > > > > Sound like another instance of msdosfs does no clustering and drive > > is too stupid to get speed without. > > IIRC there were some work on this point, but I don't now the state. > > Check the speed with dd and different blocksizes. > > This IS with dd :) > > I did a few tests.. > Block Size | Speed > ===========+=========== > 0.5k | 2.2k/sec > 1 k | 4.4k/sec > 2 k | 8.0k/sec > 4 k | 12.6k/sec > 8 k | 17.7k/sec > 16 k | 21.8k/sec > 32 k | 23.9k/sec > 64 k | 26.2k/sec > > Bleh :( Yes that drive would massivly win from IO clustering. UFS should work fine, but msdosfs... -- B.Walter BWCT http://www.bwct.de bernd@bwct.de info@bwct.de From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 04:05:22 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B066E16A4CF for ; Wed, 21 Apr 2004 04:05:22 -0700 (PDT) Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87E4C43D55 for ; Wed, 21 Apr 2004 04:05:19 -0700 (PDT) (envelope-from mark@grondar.org) Received: from storm.FreeBSD.org.uk (Ugrondar@localhost [127.0.0.1]) i3LB5IHB038310; Wed, 21 Apr 2004 12:05:18 +0100 (BST) (envelope-from mark@grondar.org) Received: (from Ugrondar@localhost)i3LB5IVA038309; Wed, 21 Apr 2004 12:05:18 +0100 (BST) (envelope-from mark@grondar.org) X-Authentication-Warning: storm.FreeBSD.org.uk: Ugrondar set sender to mark@grondar.org using -f Received: from grondar.org (localhost [127.0.0.1])i3LB3aIn033981; Wed, 21 Apr 2004 12:03:37 +0100 (BST) (envelope-from mark@grondar.org) Message-Id: <200404211103.i3LB3aIn033981@grimreaper.grondar.org> To: Kris Kennaway From: markm@FreeBSD.ORG In-Reply-To: Your message of "Wed, 21 Apr 2004 01:25:05 PDT." <20040421082505.GA75715@xor.obsecurity.org> Date: Wed, 21 Apr 2004 12:03:36 +0100 Sender: mark@grondar.org X-Spam-Score: 3.339 (***) MSGID_FROM_MTA_SHORT,NO_REAL_NAME X-Scanned-By: MIMEDefang 2.39 cc: freebsd-hackers Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 11:05:22 -0000 Kris Kennaway writes: > > loader to ignore loader.con) was that "unload" didn't help, it > > showed the kernel and modules were unloaded, but subsequent > > > > load > > boot > > > > or > > > > boot > > > > loaded the the modules again, and I had to "disable-module" for > > every individual module, about twelve times. Is that normal > > behavior, or was there a pilot error somewhere? > > I think it's expected behaviour. My fingers know what to do to stop > this, but my brain can't remember it right now :-) unload load /boot/kernel/kernel boot does it for me. M -- Mark Murray iumop ap!sdn w,I idlaH From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 20 13:00:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7491116A4CF for ; Tue, 20 Apr 2004 13:00:29 -0700 (PDT) Received: from staff.seccuris.com (staff.seccuris.com [204.112.0.40]) by mx1.FreeBSD.org (Postfix) with SMTP id 916C343D54 for ; Tue, 20 Apr 2004 13:00:28 -0700 (PDT) (envelope-from maneo@bsdpro.com) Received: (qmail 52623 invoked by uid 1006); 20 Apr 2004 20:00:27 -0000 Date: Tue, 20 Apr 2004 20:00:27 +0000 From: "Christian S.J. Peron" To: Poul-Henning Kamp Message-ID: <20040420200027.A51891@staff.seccuris.com> References: <20040420015638.A84821@staff.seccuris.com> <14522.1082452837@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <14522.1082452837@critter.freebsd.dk>; from phk@phk.freebsd.dk on Tue, Apr 20, 2004 at 11:20:37AM +0200 X-Mailman-Approved-At: Wed, 21 Apr 2004 05:07:04 -0700 cc: freebsd-hackers@freebsd.org cc: freebsd-security@freebsd.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Apr 2004 20:00:30 -0000 Poul/group The following patch makes raw sockets comply with prison IP addresses. Some tools such as traceroute(8) may require that the prison IP address be specified on the command line. I.E. traceroute -s Otherwise it might fail. (because of this we may want to get rid of the create_raw_sockets MIB all together). Anyway, take a gander at it (testers feedback welcome): Regards Christian S.J. Peron --- sys/netinet/raw_ip.c.b Mon Apr 19 16:23:57 2004 +++ sys/netinet/raw_ip.c Tue Apr 20 19:43:30 2004 @@ -40,6 +40,7 @@ #include "opt_random_ip_id.h" #include +#include #include #include #include @@ -215,6 +216,11 @@ if (inp->inp_faddr.s_addr && inp->inp_faddr.s_addr != ip->ip_src.s_addr) goto docontinue; + if (inp->inp_socket->so_cred->cr_prison) { + if (htonl(inp->inp_socket->so_cred->cr_prison->pr_ip) + != ip->ip_dst.s_addr) + goto docontinue; + } if (last) { struct mbuf *n; @@ -270,7 +276,11 @@ ip->ip_off = 0; ip->ip_p = inp->inp_ip_p; ip->ip_len = m->m_pkthdr.len; - ip->ip_src = inp->inp_laddr; + if (inp->inp_socket->so_cred->cr_prison) + ip->ip_src.s_addr = + htonl(inp->inp_socket->so_cred->cr_prison->pr_ip); + else + ip->ip_src = inp->inp_laddr; ip->ip_dst.s_addr = dst; ip->ip_ttl = inp->inp_ip_ttl; } else { @@ -279,6 +289,13 @@ return(EMSGSIZE); } ip = mtod(m, struct ip *); + if (inp->inp_socket->so_cred->cr_prison) { + if (ip->ip_src.s_addr != + htonl(inp->inp_socket->so_cred->cr_prison->pr_ip)) { + m_freem(m); + return (EPERM); + } + } /* don't allow both user specified and setsockopt options, and don't allow packet length sizes that will crash */ if (((ip->ip_hl != (sizeof (*ip) >> 2)) @@ -505,6 +522,7 @@ } } +extern int jail_allow_raw_sockets; u_long rip_sendspace = RIPSNDQ; u_long rip_recvspace = RIPRCVQ; @@ -527,7 +545,11 @@ INP_INFO_WUNLOCK(&ripcbinfo); return EINVAL; } - if (td && (error = suser(td)) != 0) { + if (td && jailed(td->td_ucred) && !jail_allow_raw_sockets) { + INP_INFO_WUNLOCK(&ripcbinfo); + return (EPERM); + } + if (td && (error = suser_cred(td->td_ucred, PRISON_ROOT)) != 0) { INP_INFO_WUNLOCK(&ripcbinfo); return error; } @@ -626,6 +648,11 @@ if (nam->sa_len != sizeof(*addr)) return EINVAL; + + if (td->td_ucred->cr_prison) + if (htonl(td->td_ucred->cr_prison->pr_ip) + != addr->sin_addr.s_addr) + return (EADDRNOTAVAIL); if (TAILQ_EMPTY(&ifnet) || (addr->sin_family != AF_INET && addr->sin_family != AF_IMPLINK) || --- sys/kern/kern_jail.c.bak Mon Apr 19 16:55:40 2004 +++ sys/kern/kern_jail.c Mon Apr 19 17:56:03 2004 @@ -53,6 +53,11 @@ &jail_sysvipc_allowed, 0, "Processes in jail can use System V IPC primitives"); +int jail_allow_raw_sockets = 0; +SYSCTL_INT(_security_jail, OID_AUTO, allow_raw_sockets, CTLFLAG_RW, + &jail_allow_raw_sockets, 0, + "Prison root can create raw sockets"); + /* allprison, lastprid, and prisoncount are protected by allprison_mtx. */ struct prisonlist allprison; struct mtx allprison_mtx; On 20 Apr 2004 Poul-Henning Kamp wrote: > In message <20040420015638.A84821@staff.seccuris.com>, "Christian S.J. Peron" w > rites: > > > > Although RAW sockets can be used when specifying the source > > address of packets (defeating one of the aspects of the jail) > > some people may find it usefull to use utilities like ping(8) > > or traceroute(8) from inside jails. > > > > Enclosed is a patch I have written which gives you the option > > of allowing prison-root to create raw sockets inside the prison, > > so that programs various network debugging programs like ping > > and traceroute etc can be used. > > > > This patch will create the security.jail.allow_raw_sockets sysctl > > MIB. I would appriciate any feed-back from testers > > > > See PR #: > > http://www.freebsd.org/cgi/query-pr.cgi?pr=65800 > > Could you take a peek and see how hard it would be to enforce source-IP > compliance with the jail restriction ? > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > _______________________________________________ > freebsd-security@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-security > To unsubscribe, send any mail to "freebsd-security-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 06:18:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4816A16A4CE; Wed, 21 Apr 2004 06:18:41 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEA6143D31; Wed, 21 Apr 2004 06:18:40 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i3LDIdtf002544; Wed, 21 Apr 2004 09:18:40 -0400 (EDT) Date: Wed, 21 Apr 2004 09:18:39 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Joe Marcus Clarke In-Reply-To: <1082524938.41182.26.camel@shumai.marcuscom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@FreeBSD.org Subject: Re: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 13:18:41 -0000 On Wed, 21 Apr 2004, Joe Marcus Clarke wrote: > On Tue, 2004-04-20 at 17:08, Daniel Eischen wrote: > > On Tue, 20 Apr 2004, Joe Marcus Clarke wrote: > > > > > I have a problem I'm hoping someone can help me with. GTK+ 2.4 > > > introduced a new file selection GUI which works just fine in threaded > > > and non-threaded applications. However, GNOME 2.6 augmented this dialog > > > with a dynamically loadable threaded shared object. The GNOME version > > > is automatically used by all GTK+ apps when run under a GNOME desktop if > > > libgnomeui is installed. > > > > Shared libraries shouldn't link with threading libraries > > unless they actually create threads behind the scenes. > > Actually, even so, they could force the (unthreaded) > > applications that link with them to explicitly supply > > the thread library in the link option. > > And that's the case here. The underlying libraries are creating and > using threads. But what happens when a non-threaded application loads a > thread library via dlopen() (which is the case here)? Here's the stack > trace I see: In that case you're going to have to link the application to a threads library. -- Dan Eischen From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 09:28:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A055B16A4CE for ; Wed, 21 Apr 2004 09:28:55 -0700 (PDT) Received: from creme-brulee.marcuscom.com (rrcs-midsouth-24-172-16-118.biz.rr.com [24.172.16.118]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3260D43D48 for ; Wed, 21 Apr 2004 09:28:55 -0700 (PDT) (envelope-from marcus@FreeBSD.org) Received: from [10.2.1.4] (vpn-client-4.marcuscom.com [10.2.1.4]) i3LGRmaI002876; Wed, 21 Apr 2004 12:27:48 -0400 (EDT) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Daniel Eischen In-Reply-To: References: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-OhXDYIDa9l/9kTwZTw9A" Organization: FreeBSD, Inc. Message-Id: <1082564941.845.6.camel@gyros> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 21 Apr 2004 12:29:01 -0400 X-Spam-Status: No, hits=-4.9 required=5.0 tests=BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on creme-brulee.marcuscom.com cc: freebsd-hackers@FreeBSD.org Subject: Re: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 16:28:55 -0000 --=-OhXDYIDa9l/9kTwZTw9A Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wed, 2004-04-21 at 09:18, Daniel Eischen wrote: > On Wed, 21 Apr 2004, Joe Marcus Clarke wrote: >=20 > > On Tue, 2004-04-20 at 17:08, Daniel Eischen wrote: > > > On Tue, 20 Apr 2004, Joe Marcus Clarke wrote: > > >=20 > > > > I have a problem I'm hoping someone can help me with. GTK+ 2.4 > > > > introduced a new file selection GUI which works just fine in thread= ed > > > > and non-threaded applications. However, GNOME 2.6 augmented this d= ialog > > > > with a dynamically loadable threaded shared object. The GNOME vers= ion > > > > is automatically used by all GTK+ apps when run under a GNOME deskt= op if > > > > libgnomeui is installed. > > >=20 > > > Shared libraries shouldn't link with threading libraries > > > unless they actually create threads behind the scenes. > > > Actually, even so, they could force the (unthreaded) > > > applications that link with them to explicitly supply > > > the thread library in the link option. > >=20 > > And that's the case here. The underlying libraries are creating and > > using threads. But what happens when a non-threaded application loads = a > > thread library via dlopen() (which is the case here)? Here's the stack > > trace I see: >=20 > In that case you're going to have to link the application > to a threads library. I had another thought based on your comments. Since -pthread does the right thing in -CURRENT, why don't we make that the default PTHREAD_LIBS? Why do we explicitly link to -lpthread when that causes shared libs to be linked to threading libraries? If we did -pthread universally, this problem would go away because ORBit would do the right thing in the non-threaded case. Joe --=20 Joe Marcus Clarke FreeBSD GNOME Team :: marcus@FreeBSD.org gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-OhXDYIDa9l/9kTwZTw9A Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAhqFNb2iPiv4Uz4cRAkYdAJwI41mr2iL8QFegqVtiH4TPretAaACfS5Vh 9r6CdbabUn+K74mXUIlgWgQ= =zqGz -----END PGP SIGNATURE----- --=-OhXDYIDa9l/9kTwZTw9A-- From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 09:52:04 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55F0216A4CE; Wed, 21 Apr 2004 09:52:04 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCCC843D39; Wed, 21 Apr 2004 09:52:03 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i3LGq3tf008155; Wed, 21 Apr 2004 12:52:03 -0400 (EDT) Date: Wed, 21 Apr 2004 12:52:03 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Joe Marcus Clarke In-Reply-To: <1082564941.845.6.camel@gyros> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@FreeBSD.org Subject: Re: Help: threading problem in non-threaded applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 16:52:04 -0000 On Wed, 21 Apr 2004, Joe Marcus Clarke wrote: > On Wed, 2004-04-21 at 09:18, Daniel Eischen wrote: > > On Wed, 21 Apr 2004, Joe Marcus Clarke wrote: > > > > > On Tue, 2004-04-20 at 17:08, Daniel Eischen wrote: > > > > On Tue, 20 Apr 2004, Joe Marcus Clarke wrote: > > > > > > > > > I have a problem I'm hoping someone can help me with. GTK+ 2.4 > > > > > introduced a new file selection GUI which works just fine in threaded > > > > > and non-threaded applications. However, GNOME 2.6 augmented this dialog > > > > > with a dynamically loadable threaded shared object. The GNOME version > > > > > is automatically used by all GTK+ apps when run under a GNOME desktop if > > > > > libgnomeui is installed. > > > > > > > > Shared libraries shouldn't link with threading libraries > > > > unless they actually create threads behind the scenes. > > > > Actually, even so, they could force the (unthreaded) > > > > applications that link with them to explicitly supply > > > > the thread library in the link option. > > > > > > And that's the case here. The underlying libraries are creating and > > > using threads. But what happens when a non-threaded application loads a > > > thread library via dlopen() (which is the case here)? Here's the stack > > > trace I see: > > > > In that case you're going to have to link the application > > to a threads library. > > I had another thought based on your comments. Since -pthread does the > right thing in -CURRENT, why don't we make that the default > PTHREAD_LIBS? Why do we explicitly link to -lpthread when that causes > shared libs to be linked to threading libraries? If we did -pthread > universally, this problem would go away because ORBit would do the right > thing in the non-threaded case. I thought your example above was creating threads behind the scenes (in the library). That would either require linking the library with -lpthread or every application that used it with -lpthread. Actually, if the library is dynamically loaded, then you still need to explicitly link the application with the threads library (or else libc is going to get confused). I think most of the problem is that our synchronization types are private to each threads library. For FreeBSD-6, we'll change that and have the synchronization types uniformly defined so that libc can see them the same way that the threads library sees them. Perhaps pthread_t will also have to be uniformly defined. So a mutex initialized by libc can be used by libpthread... I don't have a problem with PTHREAD_LIBS being changed to -pthread. I don't know if that will actually solve your particular problem, but it would probably solve other problems and make it easier to mix'n match thread libraries with applications that use the same shared libraries. -- Dan Eischen From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 10:09:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B0DC016A4CF for ; Wed, 21 Apr 2004 10:09:55 -0700 (PDT) Received: from smtp.dkm.cz (smtp.dkm.cz [62.24.64.34]) by mx1.FreeBSD.org (Postfix) with SMTP id AEB0143D5D for ; Wed, 21 Apr 2004 10:09:54 -0700 (PDT) (envelope-from neuhauser@chello.cz) Received: (qmail 77955 invoked by uid 0); 21 Apr 2004 17:09:53 -0000 Received: from r3al16.mistral.cz (HELO isis.wad.cz) (213.220.229.16) by smtp.dkm.cz with SMTP; 21 Apr 2004 17:09:53 -0000 Received: by isis.wad.cz (Postfix, from userid 1001) id 5229D2FDA01; Wed, 21 Apr 2004 19:09:53 +0200 (CEST) Date: Wed, 21 Apr 2004 19:09:52 +0200 From: Roman Neuhauser To: markm@FreeBSD.ORG Message-ID: <20040421170952.GC2088@isis.wad.cz> Mail-Followup-To: markm@FreeBSD.ORG, Kris Kennaway , freebsd-hackers References: <20040421082505.GA75715@xor.obsecurity.org> <200404211103.i3LB3aIn033981@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404211103.i3LB3aIn033981@grimreaper.grondar.org> User-Agent: Mutt/1.5.6i cc: freebsd-hackers cc: Kris Kennaway Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 17:09:55 -0000 # markm@FreeBSD.ORG / 2004-04-21 12:03:36 +0100: > Kris Kennaway writes: > > > loader to ignore loader.con) was that "unload" didn't help, it > > > showed the kernel and modules were unloaded, but subsequent > > > > > > load > > > boot > > > > > > or > > > > > > boot > > > > > > loaded the the modules again, and I had to "disable-module" for > > > every individual module, about twelve times. Is that normal > > > behavior, or was there a pilot error somewhere? > > > > I think it's expected behaviour. My fingers know what to do to stop > > this, but my brain can't remember it right now :-) > > unload > load /boot/kernel/kernel > boot > > does it for me. Of course I run unload as the first step. It wrote it unloaded the modules, and the started loading them again booting the new kernel. -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 12:23:25 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98A5D16A4CE for ; Wed, 21 Apr 2004 12:23:25 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE84943D45 for ; Wed, 21 Apr 2004 12:23:24 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc12) with ESMTP id <2004042119232301200p0lm9e>; Wed, 21 Apr 2004 19:23:23 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA32919 for ; Wed, 21 Apr 2004 12:23:22 -0700 (PDT) Date: Wed, 21 Apr 2004 12:23:20 -0700 (PDT) From: Julian Elischer To: hackers@freebsd.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 19:23:25 -0000 Ok so I have an application where I need to reread a file I have just written to ensure that it went to disk correctly.. Other than reading a few GB of data, is there a way to flush out the cache copy of a file I've written? possibilities include: a file flag saying "don't keep a copy after it's written to disk"? a syscall discard_cached_blocks(fd); ? any other suggestions? julian (BTW this would be for 4.x initially) From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:00:38 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8585916A4CE for ; Wed, 21 Apr 2004 13:00:38 -0700 (PDT) Received: from wattres.Watt.COM (wattres.watt.com [66.93.133.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6264243D45 for ; Wed, 21 Apr 2004 13:00:38 -0700 (PDT) (envelope-from steve@Watt.COM) Received: (from steve@localhost) by wattres.Watt.COM (8.12.11/8.12.11) id i3LK0ZFa065240; Wed, 21 Apr 2004 13:00:35 -0700 (PDT) (envelope-from steve) Message-Id: <200404212000.i3LK0ZFa065240@wattres.Watt.COM> X-Newsgroups: local.freebsd-hackers In-Reply-To: Organization: Watt Consultants, San Jose, CA, USA From: steve@Watt.COM (Steve Watt) Date: Wed, 21 Apr 2004 13:00:35 -0700 X-Mailer: Mail User's Shell (7.2.6 beta(5) jp(8) 11/23/00) To: julian@elischer.org cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:00:38 -0000 In article you write: > >Ok so I have an application where I need to >reread a file I have just written to ensure that it went to disk >correctly.. > >Other than reading a few GB of data, is there a way to flush >out the cache copy of a file I've written? You can flush the file to disk with fsync(). But I don't think that evicts the blocks from the cache, just forces them to be written. To the disk controller's cache, if you're lucky. >possibilities include: > >a file flag saying "don't keep a copy after it's written to disk"? >a syscall discard_cached_blocks(fd); > > >? >any other suggestions? What are you hoping to accomplish? There are probably other ways to solve the larger problem. -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" Internet: steve @ Watt.COM Whois: SW32 Free time? There's no such thing. It just comes in varying prices... From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:28:14 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A369816A4CE for ; Wed, 21 Apr 2004 13:28:14 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D68E43D49 for ; Wed, 21 Apr 2004 13:28:14 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc12) with ESMTP id <2004042120281301400i65vse>; Wed, 21 Apr 2004 20:28:13 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA33677; Wed, 21 Apr 2004 13:28:12 -0700 (PDT) Date: Wed, 21 Apr 2004 13:28:12 -0700 (PDT) From: Julian Elischer To: Steve Watt In-Reply-To: <200404212000.i3LK0ZFa065240@wattres.Watt.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:28:14 -0000 On Wed, 21 Apr 2004, Steve Watt wrote: > In article you write: > > > >Ok so I have an application where I need to > >reread a file I have just written to ensure that it went to disk > >correctly.. > > > >Other than reading a few GB of data, is there a way to flush > >out the cache copy of a file I've written? > > You can flush the file to disk with fsync(). But I don't think that > evicts the blocks from the cache, just forces them to be written. To > the disk controller's cache, if you're lucky. > > >possibilities include: > > > >a file flag saying "don't keep a copy after it's written to disk"? > >a syscall discard_cached_blocks(fd); > > > > > >? > >any other suggestions? > > What are you hoping to accomplish? There are probably other ways > to solve the larger problem. I thought I was being clear.. I need to remove all the pages from cache so that a reread of the file is forced to go to disk. and I don't want to go read a 2GB dummy file to force the flush.. Someone suggested that I read the file usign 'dump' through the raw device.. > > -- > Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" > Internet: steve @ Watt.COM Whois: SW32 > Free time? There's no such thing. It just comes in varying prices... > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:33:01 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4B58716A4CE for ; Wed, 21 Apr 2004 13:33:01 -0700 (PDT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38F7043D2F for ; Wed, 21 Apr 2004 13:33:01 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc12) with ESMTP id <2004042120330001400i6mp5e>; Wed, 21 Apr 2004 20:33:00 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA33733; Wed, 21 Apr 2004 13:33:00 -0700 (PDT) Date: Wed, 21 Apr 2004 13:32:58 -0700 (PDT) From: Julian Elischer To: Steve Watt In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:33:01 -0000 On Wed, 21 Apr 2004, Julian Elischer wrote: > > > On Wed, 21 Apr 2004, Steve Watt wrote: > > > In article you write: > > > > > >Ok so I have an application where I need to > > >reread a file I have just written to ensure that it went to disk > > >correctly.. > > > > > >Other than reading a few GB of data, is there a way to flush > > >out the cache copy of a file I've written? > > > > You can flush the file to disk with fsync(). But I don't think that > > evicts the blocks from the cache, just forces them to be written. To > > the disk controller's cache, if you're lucky. > > > > >possibilities include: > > > > > >a file flag saying "don't keep a copy after it's written to disk"? > > >a syscall discard_cached_blocks(fd); Turns out O_DIRECT might do this, but I can't use this as apparently it's being written by a 3rd party program.. I can only check the file after the other program has written it.. > > > > > > > > >? > > >any other suggestions? > > > > What are you hoping to accomplish? There are probably other ways > > to solve the larger problem. > > I thought I was being clear.. > I need to remove all the pages from cache so that a reread of the file > is forced to go to disk. > and I don't want to go read a 2GB dummy file to force the flush.. > > Someone suggested that I read the file usign 'dump' through the raw > device.. > > > > > > -- > > Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" > > Internet: steve @ Watt.COM Whois: SW32 > > Free time? There's no such thing. It just comes in varying prices... > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:37:51 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5786516A4CE for ; Wed, 21 Apr 2004 13:37:51 -0700 (PDT) Received: from wattres.Watt.COM (wattres.watt.com [66.93.133.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3916243D60 for ; Wed, 21 Apr 2004 13:37:51 -0700 (PDT) (envelope-from steve@Watt.COM) Received: (from steve@localhost) by wattres.Watt.COM (8.12.11/8.12.11) id i3LKbnpT069214; Wed, 21 Apr 2004 13:37:49 -0700 (PDT) (envelope-from steve) Message-Id: <200404212037.i3LKbnpT069214@wattres.Watt.COM> From: steve@Watt.COM (Steve Watt) Date: Wed, 21 Apr 2004 13:37:49 -0700 In-Reply-To: Julian Elischer "Re: how to flush out cache.?" (Apr 21, 13:28) X-Mailer: Mail User's Shell (7.2.6 beta(5) jp(8) 11/23/00) To: Julian Elischer cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:37:51 -0000 On Apr 21, 13:28, Julian Elischer wrote: } Subject: Re: how to flush out cache.? } } On Wed, 21 Apr 2004, Steve Watt wrote: } } > In article you write: } > > } > >Ok so I have an application where I need to } > >reread a file I have just written to ensure that it went to disk } > >correctly.. } > } > What are you hoping to accomplish? There are probably other ways } > to solve the larger problem. } } I thought I was being clear.. } I need to remove all the pages from cache so that a reread of the file } is forced to go to disk. } and I don't want to go read a 2GB dummy file to force the flush.. No, my question is "what are you trying to accomplish with the reread", at a higher level than "I want to know it's on disk". Is there some reason you have for not trusting the hardware? Are you trying to do a database commit protocol? Debugging the storage system? } Someone suggested that I read the file usign 'dump' through the raw } device.. Even doing that doesn't necessarily mean the bits have made it onto the rotating media. There can also be caches in the disk controller, and/or caches on the drive itself. If you're trying for a case where you want to pull the power, unmounting and remounting the filesystem will get it about as close as you can. -- Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" Internet: steve @ Watt.COM Whois: SW32 Free time? There's no such thing. It just comes in varying prices... From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:38:37 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4388C16A4CE for ; Wed, 21 Apr 2004 13:38:37 -0700 (PDT) Received: from smtp0.server.rpi.edu (smtp0.server.rpi.edu [128.113.53.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id ED0AE43D5D for ; Wed, 21 Apr 2004 13:38:36 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp0.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i3LKcXEd019399; Wed, 21 Apr 2004 16:38:34 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: References: Date: Wed, 21 Apr 2004 16:38:32 -0400 To: Julian Elischer , hackers@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:38:37 -0000 At 12:23 PM -0700 4/21/04, Julian Elischer wrote: >Ok so I have an application where I need to >reread a file I have just written to ensure that it went to disk >correctly.. > >Other than reading a few GB of data, is there a way to flush >out the cache copy of a file I've written? > >possibilities include: > >a file flag saying "don't keep a copy after it's written to disk"? >a syscall discard_cached_blocks(fd); > > >? >any other suggestions? > >julian >(BTW this would be for 4.x initially) Hmm. That means you couldn't use a 'snapshot' to force the issue, right? If you *could* use snapshots, you could close the file, snapshot the partition, mount the snapshot, and read the file from it's copy in the snapshot-filesystem. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:44:19 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB52916A4CE for ; Wed, 21 Apr 2004 13:44:19 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE01443D45 for ; Wed, 21 Apr 2004 13:44:19 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc12) with ESMTP id <2004042120441801200oq9ade>; Wed, 21 Apr 2004 20:44:19 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA33946; Wed, 21 Apr 2004 13:44:17 -0700 (PDT) Date: Wed, 21 Apr 2004 13:44:16 -0700 (PDT) From: Julian Elischer To: Steve Watt In-Reply-To: <200404212037.i3LKbnpT069214@wattres.Watt.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:44:20 -0000 On Wed, 21 Apr 2004, Steve Watt wrote: > On Apr 21, 13:28, Julian Elischer wrote: > } Subject: Re: how to flush out cache.? > } > } On Wed, 21 Apr 2004, Steve Watt wrote: > } > } > In article you write: > } > > > } > >Ok so I have an application where I need to > } > >reread a file I have just written to ensure that it went to disk > } > >correctly.. > } > > } > What are you hoping to accomplish? There are probably other ways > } > to solve the larger problem. > } > } I thought I was being clear.. > } I need to remove all the pages from cache so that a reread of the file > } is forced to go to disk. > } and I don't want to go read a 2GB dummy file to force the flush.. > > No, my question is "what are you trying to accomplish with the > reread", at a higher level than "I want to know it's on disk". Is > there some reason you have for not trusting the hardware? Are you > trying to do a database commit protocol? Debugging the storage > system? we are getting data curruptions occasionally and we are trying to track it down.. if we wait a half hour so the cache is flushed out, teh file sometimes checksums differently and has bad data in it but by then the original files have gone away so we have a tough time recreating the data.. This is also to help us figure out where the problem is... but since we have seen this several times we'd like to add a "check that data on disk" option to our application, to help track this down in the future if it appears to be happenning again. if it's happenned several times it can happen again. > > } Someone suggested that I read the file usign 'dump' through the raw > } device.. > > Even doing that doesn't necessarily mean the bits have made it onto > the rotating media. There can also be caches in the disk controller, > and/or caches on the drive itself. If you're trying for a case where > you want to pull the power, unmounting and remounting the filesystem > will get it about as close as you can. > > -- > Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" > Internet: steve @ Watt.COM Whois: SW32 > Free time? There's no such thing. It just comes in varying prices... > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:46:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E6A016A4CE for ; Wed, 21 Apr 2004 13:46:06 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4CD2143D39 for ; Wed, 21 Apr 2004 13:46:06 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004042120460501500q5e08e>; Wed, 21 Apr 2004 20:46:05 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA33989; Wed, 21 Apr 2004 13:46:05 -0700 (PDT) Date: Wed, 21 Apr 2004 13:46:04 -0700 (PDT) From: Julian Elischer To: Steve Watt In-Reply-To: <200404212037.i3LKbnpT069214@wattres.Watt.COM> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:46:06 -0000 On Wed, 21 Apr 2004, Steve Watt wrote: > On Apr 21, 13:28, Julian Elischer wrote: > } Subject: Re: how to flush out cache.? > } > } On Wed, 21 Apr 2004, Steve Watt wrote: > } > } > In article you write: > } > > > } > >Ok so I have an application where I need to > } > >reread a file I have just written to ensure that it went to disk > } > >correctly.. > } > > } > What are you hoping to accomplish? There are probably other ways > } > to solve the larger problem. > } > } I thought I was being clear.. > } I need to remove all the pages from cache so that a reread of the file > } is forced to go to disk. > } and I don't want to go read a 2GB dummy file to force the flush.. > > No, my question is "what are you trying to accomplish with the > reread", at a higher level than "I want to know it's on disk". Is > there some reason you have for not trusting the hardware? Are you > trying to do a database commit protocol? Debugging the storage > system? > > } Someone suggested that I read the file usign 'dump' through the raw > } device.. > > Even doing that doesn't necessarily mean the bits have made it onto > the rotating media. There can also be caches in the disk controller, > and/or caches on the drive itself. If you're trying for a case where > you want to pull the power, unmounting and remounting the filesystem > will get it about as close as you can. The disk caches are small enough.. we are talking about multi gigabyte files getting a few blocks bad somewhere in the middle. (and yes the machines have enough RAM to cache the files). > > -- > Steve Watt KD6GGD PP-ASEL-IA ICBM: 121W 56' 57.8" / 37N 20' 14.9" > Internet: steve @ Watt.COM Whois: SW32 > Free time? There's no such thing. It just comes in varying prices... > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 13:47:45 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4A84A16A4CE for ; Wed, 21 Apr 2004 13:47:45 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A44143D53 for ; Wed, 21 Apr 2004 13:47:45 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (rwcrmhc13) with ESMTP id <2004042120474401500q0qeke>; Wed, 21 Apr 2004 20:47:44 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA34030; Wed, 21 Apr 2004 13:47:44 -0700 (PDT) Date: Wed, 21 Apr 2004 13:47:43 -0700 (PDT) From: Julian Elischer To: Garance A Drosihn In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 20:47:45 -0000 On Wed, 21 Apr 2004, Garance A Drosihn wrote: > At 12:23 PM -0700 4/21/04, Julian Elischer wrote: > >Ok so I have an application where I need to > >reread a file I have just written to ensure that it went to disk > >correctly.. > > > >Other than reading a few GB of data, is there a way to flush > >out the cache copy of a file I've written? > > > >possibilities include: > > > >a file flag saying "don't keep a copy after it's written to disk"? > >a syscall discard_cached_blocks(fd); > > > > > >? > >any other suggestions? > > > >julian > >(BTW this would be for 4.x initially) > > Hmm. That means you couldn't use a 'snapshot' to force the > issue, right? If you *could* use snapshots, you could close > the file, snapshot the partition, mount the snapshot, and > read the file from it's copy in the snapshot-filesystem. ingenious, but, no we can't do that.. As I mentionned.. someone suggested using 'dump' to extract the file from raw disk and checksumming that... :-) > > -- > Garance Alistair Drosehn = gad@gilead.netel.rpi.edu > Senior Systems Programmer or gad@freebsd.org > Rensselaer Polytechnic Institute or drosih@rpi.edu > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 14:14:16 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4714F16A4CE for ; Wed, 21 Apr 2004 14:14:16 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 7D17143D3F for ; Wed, 21 Apr 2004 14:14:15 -0700 (PDT) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 21 Apr 2004 22:14:14 +0100 (BST) Date: Wed, 21 Apr 2004 22:14:13 +0100 From: David Malone To: Julian Elischer Message-ID: <20040421211413.GA50578@walton.maths.tcd.ie> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.3i Sender: dwmalone@maths.tcd.ie cc: hackers@freebsd.org cc: Garance A Drosihn Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 21:14:16 -0000 On Wed, Apr 21, 2004 at 01:47:43PM -0700, Julian Elischer wrote: > ingenious, but, no we can't do that.. > As I mentionned.. someone suggested using 'dump' > to extract the file from raw disk and checksumming that... :-) If it is SCSI, you could probably put a second controler on the SCSI bus, and when you want to checksum the file you mount the filesystem read-only using using the device for the same disk via the second SCSI controler. David. From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 14:38:27 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC92B16A4CE for ; Wed, 21 Apr 2004 14:38:27 -0700 (PDT) Received: from mxsf23.cluster1.charter.net (mxsf23.cluster1.charter.net [209.225.28.223]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17D7043D1F for ; Wed, 21 Apr 2004 14:38:27 -0700 (PDT) (envelope-from ups@tree.com) Received: from stups.com ([209.187.143.11])i3LLLx52018233; Wed, 21 Apr 2004 17:21:59 -0400 (EDT) Received: from tree.com (localhost [127.0.0.1]) by stups.com (8.9.3/8.9.3) with ESMTP id RAA14907; Wed, 21 Apr 2004 17:21:58 -0400 Message-Id: <200404212121.RAA14907@stups.com> X-Mailer: exmh version 2.0.2 To: Julian Elischer In-Reply-To: Message from Julian Elischer Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 21 Apr 2004 17:21:58 -0400 From: Stephan Uphoff cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 21:38:27 -0000 mmap() and msync(..MS_INVALIDATE..) should work. Stephan > > Ok so I have an application where I need to > reread a file I have just written to ensure that it went to disk > correctly.. > > Other than reading a few GB of data, is there a way to flush > out the cache copy of a file I've written? > > possibilities include: > > a file flag saying "don't keep a copy after it's written to disk"? > a syscall discard_cached_blocks(fd); > > > ? > any other suggestions? > > julian > (BTW this would be for 4.x initially) > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 14:53:29 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87F3D16A4CE for ; Wed, 21 Apr 2004 14:53:29 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id A76D043D4C for ; Wed, 21 Apr 2004 14:53:28 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004042121532701100pe3gbe>; Wed, 21 Apr 2004 21:53:27 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id OAA34917; Wed, 21 Apr 2004 14:53:26 -0700 (PDT) Date: Wed, 21 Apr 2004 14:53:26 -0700 (PDT) From: Julian Elischer To: Stephan Uphoff In-Reply-To: <200404212121.RAA14907@stups.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: dillon@backplane.com cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 21:53:29 -0000 On Wed, 21 Apr 2004, Stephan Uphoff wrote: > > mmap() and msync(..MS_INVALIDATE..) should work. hmmm that is rather interesting.. I wonder if it would work.... Maybe a vm guru could confirm this.. (under 4.x) > > Stephan > > > > > Ok so I have an application where I need to > > reread a file I have just written to ensure that it went to disk > > correctly.. > > > > Other than reading a few GB of data, is there a way to flush > > out the cache copy of a file I've written? > > > > possibilities include: > > > > a file flag saying "don't keep a copy after it's written to disk"? > > a syscall discard_cached_blocks(fd); > > > > > > ? > > any other suggestions? > > > > julian > > (BTW this would be for 4.x initially) > > > > > > _______________________________________________ > > freebsd-hackers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > > > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 15:55:25 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 40F4716A4CE for ; Wed, 21 Apr 2004 15:55:25 -0700 (PDT) Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C03F43D53 for ; Wed, 21 Apr 2004 15:55:20 -0700 (PDT) (envelope-from mark@grondar.org) Received: from storm.FreeBSD.org.uk (Ugrondar@localhost [127.0.0.1]) i3LMtCM6048794; Wed, 21 Apr 2004 23:55:12 +0100 (BST) (envelope-from mark@grondar.org) Received: (from Ugrondar@localhost)i3LMtCCO048793; Wed, 21 Apr 2004 23:55:12 +0100 (BST) (envelope-from mark@grondar.org) X-Authentication-Warning: storm.FreeBSD.org.uk: Ugrondar set sender to mark@grondar.org using -f Received: from grondar.org (localhost [127.0.0.1])i3LMshIn039032; Wed, 21 Apr 2004 23:54:44 +0100 (BST) (envelope-from mark@grondar.org) Message-Id: <200404212254.i3LMshIn039032@grimreaper.grondar.org> To: Roman Neuhauser From: markm@FreeBSD.ORG In-Reply-To: Your message of "Wed, 21 Apr 2004 19:09:52 +0200." <20040421170952.GC2088@isis.wad.cz> Date: Wed, 21 Apr 2004 23:54:43 +0100 Sender: mark@grondar.org X-Spam-Score: 3.339 (***) MSGID_FROM_MTA_SHORT,NO_REAL_NAME X-Scanned-By: MIMEDefang 2.39 cc: freebsd-hackers Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 22:55:25 -0000 Roman Neuhauser writes: > > unload > > load /boot/kernel/kernel > > boot > > > > does it for me. > > Of course I run unload as the first step. It wrote it unloaded the > modules, and the started loading them again booting the new kernel. Did you type the exact THREE commands as shown above? M -- Mark Murray iumop ap!sdn w,I idlaH From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 16:45:01 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA63F16A4CF for ; Wed, 21 Apr 2004 16:45:01 -0700 (PDT) Received: from smtp.dkm.cz (smtp.dkm.cz [62.24.64.34]) by mx1.FreeBSD.org (Postfix) with SMTP id ACEF143D54 for ; Wed, 21 Apr 2004 16:45:00 -0700 (PDT) (envelope-from neuhauser@chello.cz) Received: (qmail 71399 invoked by uid 0); 21 Apr 2004 23:44:59 -0000 Received: from r3al16.mistral.cz (HELO isis.wad.cz) (213.220.229.16) by smtp.dkm.cz with SMTP; 21 Apr 2004 23:44:59 -0000 Received: by isis.wad.cz (Postfix, from userid 1001) id DEAC22FDA01; Thu, 22 Apr 2004 01:44:58 +0200 (CEST) Date: Thu, 22 Apr 2004 01:44:58 +0200 From: Roman Neuhauser To: markm@FreeBSD.ORG Message-ID: <20040421234458.GA37208@isis.wad.cz> Mail-Followup-To: markm@FreeBSD.ORG, freebsd-hackers References: <20040421170952.GC2088@isis.wad.cz> <200404212254.i3LMshIn039032@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404212254.i3LMshIn039032@grimreaper.grondar.org> User-Agent: Mutt/1.5.6i cc: freebsd-hackers Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2004 23:45:02 -0000 # markm@FreeBSD.ORG / 2004-04-21 23:54:43 +0100: > Roman Neuhauser writes: > > > unload > > > load /boot/kernel/kernel > > > boot > > > > > > does it for me. > > > > Of course I run unload as the first step. It wrote it unloaded the > > modules, and the started loading them again booting the new kernel. > > Did you type the exact THREE commands as shown above? Of course, it's been three weeks since I had that problem so I would be insane to claim I have exact recollection. I might have been typing unload boot /boot/kernel/kernel over and over again in an attempt to convince myself that I had made a typo, but I doubt that. Nevertheless, would that make a difference? It's more likely (= I'm quite sure) I tried both versions more than once; I *really* wanted to avoid typing "disable-module " twelve or so times, which I ended up doing. Also note that we're talking about CURRENT in case that could mean a difference. Hm, I still have the exact same kernel/world on the machine. I'll try it out in the morning, and will let you know. -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 18:02:25 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A40416A4CE for ; Wed, 21 Apr 2004 18:02:25 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B49643D31 for ; Wed, 21 Apr 2004 18:02:25 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3M12N7Z097319; Wed, 21 Apr 2004 18:02:23 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3M12Lrl097316; Wed, 21 Apr 2004 18:02:21 -0700 (PDT) (envelope-from dillon) Date: Wed, 21 Apr 2004 18:02:21 -0700 (PDT) From: Matthew Dillon Message-Id: <200404220102.i3M12Lrl097316@apollo.backplane.com> To: Julian Elischer References: cc: hackers@freebsd.org cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 01:02:25 -0000 : :> :> mmap() and msync(..MS_INVALIDATE..) should work. : :hmmm that is rather interesting.. :I wonder if it would work.... :Maybe a vm guru could confirm this.. (under 4.x) : Huh. If I hadn't looked at the code I would have said that MS_INVALIDATE doesn't work in FreeBSD, but when I look at the code it sure looks like it ought to work! But, alas, it does not. The invalidation request goes all the way through to the vnode pager but it looks like the vnode pager ignores it. MS_INVALIDATE -> OBJPC_INVAL -> VM_PAGER_PUT_INVAL -> IO_INVAL -> (ignored) IO_INVAL is defined to be 'invalidate after I/O completes', not 'throw away the dirty data', but the only place it appears to be implemented is in the NFS code. -Matt From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 18:14:09 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3C3A16A4CE for ; Wed, 21 Apr 2004 18:14:08 -0700 (PDT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FBD443D5C for ; Wed, 21 Apr 2004 18:14:08 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc13) with ESMTP id <2004042201140601600d3ffre>; Thu, 22 Apr 2004 01:14:07 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id SAA36944; Wed, 21 Apr 2004 18:14:05 -0700 (PDT) Date: Wed, 21 Apr 2004 18:14:04 -0700 (PDT) From: Julian Elischer To: Matthew Dillon In-Reply-To: <200404220102.i3M12Lrl097316@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 01:14:09 -0000 On Wed, 21 Apr 2004, Matthew Dillon wrote: > : > :> > :> mmap() and msync(..MS_INVALIDATE..) should work. > : > :hmmm that is rather interesting.. > :I wonder if it would work.... > :Maybe a vm guru could confirm this.. (under 4.x) > : > > Huh. If I hadn't looked at the code I would have said that > MS_INVALIDATE doesn't work in FreeBSD, but when I look at the code > it sure looks like it ought to work! > > But, alas, it does not. The invalidation request goes all the way > through to the vnode pager but it looks like the vnode pager ignores > it. > > MS_INVALIDATE -> OBJPC_INVAL -> VM_PAGER_PUT_INVAL -> IO_INVAL -> (ignored) > > IO_INVAL is defined to be 'invalidate after I/O completes', > not 'throw away the dirty data', but the only place it appears to be > implemented is in the NFS code. Actually what I'm looking for is "throw away clean data" I want to dump the cached version of a file so that I can force a reread of the disk. > > -Matt > > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 18:40:13 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB4CB16A4CE for ; Wed, 21 Apr 2004 18:40:13 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D55943D53 for ; Wed, 21 Apr 2004 18:40:13 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3M1e97Z097496; Wed, 21 Apr 2004 18:40:09 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3M1e9l9097495; Wed, 21 Apr 2004 18:40:09 -0700 (PDT) (envelope-from dillon) Date: Wed, 21 Apr 2004 18:40:09 -0700 (PDT) From: Matthew Dillon Message-Id: <200404220140.i3M1e9l9097495@apollo.backplane.com> To: Julian Elischer References: cc: hackers@freebsd.org cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 01:40:14 -0000 :Actually what I'm looking for is :"throw away clean data" : :I want to dump the cached version of a file so that I can force a reread :of the disk. MS_INVALIDATE doesn't do that. madvise()'s MADV_FREE does what you want, BUT it does not currently work (at least on 4.x or in DFly) on file-backed data, it only works with anonymous memory. I believe that on some systems MADV_FREE does what you expect, e.g. like on Solaris (though I am not 100% sure), so it would not be far-fetched to go and implement it. -Matt Matthew Dillon From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 19:04:58 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 85F1F16A4CF for ; Wed, 21 Apr 2004 19:04:58 -0700 (PDT) Received: from mxsf20.cluster1.charter.net (mxsf20.cluster1.charter.net [209.225.28.220]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74E7743D3F for ; Wed, 21 Apr 2004 19:04:57 -0700 (PDT) (envelope-from ups@tree.com) Received: from stups.com ([209.187.143.11])i3M1qhRn052054; Wed, 21 Apr 2004 21:52:44 -0400 (EDT) Received: from tree.com (localhost [127.0.0.1]) by stups.com (8.9.3/8.9.3) with ESMTP id VAA26897; Wed, 21 Apr 2004 21:52:43 -0400 Message-Id: <200404220152.VAA26897@stups.com> X-Mailer: exmh version 2.0.2 To: Matthew Dillon In-Reply-To: Message from Matthew Dillon <200404220102.i3M12Lrl097316@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 21 Apr 2004 21:52:43 -0400 From: Stephan Uphoff cc: hackers@freebsd.org cc: Julian Elischer cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 02:04:58 -0000 Matthew Dillon wrote: > : > :> > :> mmap() and msync(..MS_INVALIDATE..) should work. > : > :hmmm that is rather interesting.. > :I wonder if it would work.... > :Maybe a vm guru could confirm this.. (under 4.x) > : > > Huh. If I hadn't looked at the code I would have said that > MS_INVALIDATE doesn't work in FreeBSD, but when I look at the code > it sure looks like it ought to work! > > But, alas, it does not. The invalidation request goes all the way > through to the vnode pager but it looks like the vnode pager ignores > it. > > MS_INVALIDATE -> OBJPC_INVAL -> VM_PAGER_PUT_INVAL -> IO_INVAL -> (ignored) > > IO_INVAL is defined to be 'invalidate after I/O completes', > not 'throw away the dirty data', but the only place it appears to be > implemented is in the NFS code. > > -Matt Yes - but FreeBSD then calls vm_object_page_remove to remove the pages from the vnode object. (vm_object_sync for 5.x or vm_map_clean for 4.x ) Mhhh .. 4.X removes the pages without flushing if the file is not write mapped. This means that anyone with read access can screw up a file. ( For example periodically throwing away pages from /var/log/wtmp ...) 5.x looks better - but there is a race condition that can cause the same thing. I think for msync() the vm_object_page_remove() function should be called with clean_only set to TRUE to avoid throwing away valid changes. ( I will send-pr tomorrow ) Stephan From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 19:31:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41FFB16A4CE for ; Wed, 21 Apr 2004 19:31:41 -0700 (PDT) Received: from mxsf11.cluster1.charter.net (mxsf11.cluster1.charter.net [209.225.28.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB6FD43D1F for ; Wed, 21 Apr 2004 19:31:40 -0700 (PDT) (envelope-from ups@tree.com) Received: from stups.com ([209.187.143.11])i3M2HrcZ057229; Wed, 21 Apr 2004 22:17:53 -0400 (EDT) Received: from tree.com (localhost [127.0.0.1]) by stups.com (8.9.3/8.9.3) with ESMTP id WAA28285; Wed, 21 Apr 2004 22:17:52 -0400 Message-Id: <200404220217.WAA28285@stups.com> X-Mailer: exmh version 2.0.2 To: Stephan Uphoff In-Reply-To: Message from Stephan Uphoff of "Wed, 21 Apr 2004 21:52:43 EDT." <200404220152.VAA26897@stups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 21 Apr 2004 22:17:52 -0400 From: Stephan Uphoff cc: hackers@freebsd.org cc: Julian Elischer Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 02:31:41 -0000 Stephan Uphoff wrote: > Matthew Dillon wrote: > > : > > :> > > :> mmap() and msync(..MS_INVALIDATE..) should work. > > : > > :hmmm that is rather interesting.. > > :I wonder if it would work.... > > :Maybe a vm guru could confirm this.. (under 4.x) > > : > > > > Huh. If I hadn't looked at the code I would have said that > > MS_INVALIDATE doesn't work in FreeBSD, but when I look at the code > > it sure looks like it ought to work! > > > > But, alas, it does not. The invalidation request goes all the way > > through to the vnode pager but it looks like the vnode pager ignores > > it. > > > > MS_INVALIDATE -> OBJPC_INVAL -> VM_PAGER_PUT_INVAL -> IO_INVAL -> (ignored) > > > > IO_INVAL is defined to be 'invalidate after I/O completes', > > not 'throw away the dirty data', but the only place it appears to be > > implemented is in the NFS code. > > > > -Matt > > > Yes - but FreeBSD then calls vm_object_page_remove to remove the pages > from the vnode object. (vm_object_sync for 5.x or vm_map_clean for 4.x ) > > Mhhh .. 4.X removes the pages without flushing if the file is not write > mapped. > This means that anyone with read access can screw up a file. A file with dirty (unflushed) pages. > ( For example periodically throwing away pages from /var/log/wtmp ...) > 5.x looks better - but there is a race condition that can cause the same thing. > I think for msync() the vm_object_page_remove() function should be called with > clean_only set to TRUE to avoid throwing away valid changes. > ( I will send-pr tomorrow ) > > Stephan > > > From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 21 20:48:43 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23E2216A4CE for ; Wed, 21 Apr 2004 20:48:43 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id C3C1943D53 for ; Wed, 21 Apr 2004 20:48:42 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3M3me7Z097987; Wed, 21 Apr 2004 20:48:41 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3M3merS097986; Wed, 21 Apr 2004 20:48:40 -0700 (PDT) (envelope-from dillon) Date: Wed, 21 Apr 2004 20:48:40 -0700 (PDT) From: Matthew Dillon Message-Id: <200404220348.i3M3merS097986@apollo.backplane.com> To: Stephan Uphoff References: <200404220152.VAA26897@stups.com> cc: hackers@freebsd.org cc: Julian Elischer cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 03:48:43 -0000 :Yes - but FreeBSD then calls vm_object_page_remove to remove the pages :from the vnode object. (vm_object_sync for 5.x or vm_map_clean for 4.x ) : :Mhhh .. 4.X removes the pages without flushing if the file is not write :mapped. :This means that anyone with read access can screw up a file. :( For example periodically throwing away pages from /var/log/wtmp ...) :5.x looks better - but there is a race condition that can cause the same thing. :I think for msync() the vm_object_page_remove() function should be called with :clean_only set to TRUE to avoid throwing away valid changes. :( I will send-pr tomorrow ) : : Stephan I don't quite see that. Could you point out the code in question? (And, of course, a test program would tell us for sure whether that hole exists). There are two different things being removed... the page table entries are removed from pmap via the vm_map for the process, and the pages in the underlying object are being cleaned. Just removing pages from a pmap will not destroy the underlying pages. (I'm not saying that you are wrong, just that we need more information to figure out what is actually happening here). -Matt Matthew Dillon From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 00:05:15 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C134916A4CE for ; Thu, 22 Apr 2004 00:05:15 -0700 (PDT) Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9104643D46 for ; Thu, 22 Apr 2004 00:05:10 -0700 (PDT) (envelope-from mark@grondar.org) Received: from storm.FreeBSD.org.uk (Ugrondar@localhost [127.0.0.1]) i3M75800042119; Thu, 22 Apr 2004 08:05:08 +0100 (BST) (envelope-from mark@grondar.org) Received: (from Ugrondar@localhost)i3M758nC042113; Thu, 22 Apr 2004 08:05:08 +0100 (BST) (envelope-from mark@grondar.org) X-Authentication-Warning: storm.FreeBSD.org.uk: Ugrondar set sender to mark@grondar.org using -f Received: from grondar.org (localhost [127.0.0.1])i3M724In042266; Thu, 22 Apr 2004 08:02:04 +0100 (BST) (envelope-from mark@grondar.org) Message-Id: <200404220702.i3M724In042266@grimreaper.grondar.org> To: Roman Neuhauser From: markm@FreeBSD.ORG In-Reply-To: Your message of "Thu, 22 Apr 2004 01:44:58 +0200." <20040421234458.GA37208@isis.wad.cz> Date: Thu, 22 Apr 2004 08:02:04 +0100 Sender: mark@grondar.org X-Spam-Score: 3.339 (***) MSGID_FROM_MTA_SHORT,NO_REAL_NAME X-Scanned-By: MIMEDefang 2.39 cc: freebsd-hackers Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 07:05:15 -0000 Roman Neuhauser writes: > > Did you type the exact THREE commands as shown above? > > Of course, it's been three weeks since I had that problem so I > would be insane to claim I have exact recollection. I might have > been typing > > unload > boot /boot/kernel/kernel > > over and over again in an attempt to convince myself that I had made > a typo, but I doubt that. Nevertheless, would that make a difference? Yes. M -- Mark Murray iumop ap!sdn w,I idlaH From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 02:21:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA3D116A4CE; Thu, 22 Apr 2004 02:21:54 -0700 (PDT) Received: from dragonfly.sitetronics.com (zp-c-13e65.mxs.adsl.euronet.nl [81.69.92.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79F3A43D60; Thu, 22 Apr 2004 02:21:53 -0700 (PDT) (envelope-from dodell@dragonfly.sitetronics.com) Received: from dragonfly.sitetronics.com (dragonfly [127.0.0.1]) i3MBLKhQ001102; Thu, 22 Apr 2004 11:21:20 GMT (envelope-from dodell@dragonfly.sitetronics.com) Received: (from dodell@localhost)i3MBLK9I001101; Thu, 22 Apr 2004 11:21:20 GMT (envelope-from dodell) Date: Thu, 22 Apr 2004 11:21:20 +0000 From: "Devon H. O'Dell" To: "Christian S.J. Peron" Message-ID: <20040422112120.GB888@sitetronics.com> References: <20040420015638.A84821@staff.seccuris.com> <14522.1082452837@critter.freebsd.dk> <20040420200027.A51891@staff.seccuris.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040420200027.A51891@staff.seccuris.com> User-Agent: Mutt/1.4.2.1i X-Mailer: Mutt 1.3.23i (2001-10-09) X-Editor: Vim http://www.vim.org/ cc: freebsd-hackers@freebsd.org cc: Poul-Henning Kamp cc: freebsd-security@freebsd.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 09:21:54 -0000 Christian S.J. Peron scribbled: > Poul/group > > The following patch makes raw sockets comply with prison IP addresses. > Some tools such as traceroute(8) may require that the prison IP address > be specified on the command line. I.E. > > traceroute -s > > Otherwise it might fail. > > (because of this we may want to get rid of the > create_raw_sockets MIB all together). > > Anyway, take a gander at it (testers feedback welcome): > > Regards > Christian S.J. Peron Nice work! It doesn't seem that it would be very difficult to get this to comply with Pawels multiple IPs in jail patch, but it would have to be optimized a bit as the IPs are currently stored in a linked list in his patch and traversing that list to determine whether the IP complies with the jails allotted IP range is sub-optimal (as it would have to be done on a per-packet basis). If we could store those IPs in a hash table with a fast algorithm for O(1) lookup times, the prison subsystem would experience significant feature improvements. -- Kind regards, Devon H. O'Dell | dodell@sitetronics.com ICQ: 2903604 | IRC: dho@freenode/dodell@efnet From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 02:54:18 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1263616A4CE for ; Thu, 22 Apr 2004 02:54:18 -0700 (PDT) Received: from blurp.one.pl (blurp.t4.ds.pwr.wroc.pl [156.17.226.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD76343D31 for ; Thu, 22 Apr 2004 02:54:17 -0700 (PDT) (envelope-from gizmen@blurp.one.pl) Received: by blurp.one.pl (Postfix, from userid 1001) id A2A3EA5B; Thu, 22 Apr 2004 11:54:15 +0200 (CEST) Date: Thu, 22 Apr 2004 11:54:15 +0200 From: GiZmen To: freebsd-hackers@freebsd.org Message-ID: <20040422095415.GA31126@blurp.one.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 09:54:18 -0000 Hello, Is there any way to change ttl of incoming packet to a lower value ? I had tried min-ttl option in pf packet filter but this option only increase ttl to a given value when ttl is lower than this value. I have searched on google and mailing lists but i do not find any answer. I am running Freebsd 5.2.1 and i am using pf as my packet filter. Thanks for any tips -- Best Regards: GiZmen UNIX is user-friendly; it's just picky about its friends UNIX is simple; it just takes a genius to understand its simplicity From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 04:30:23 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4103116A4CF; Thu, 22 Apr 2004 04:30:23 -0700 (PDT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1462E43D2D; Thu, 22 Apr 2004 04:30:10 -0700 (PDT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id DCC39ACC5C; Thu, 22 Apr 2004 13:30:02 +0200 (CEST) Date: Thu, 22 Apr 2004 13:30:02 +0200 From: Pawel Jakub Dawidek To: "Christian S.J. Peron" Message-ID: <20040422113002.GW24376@darkness.comp.waw.pl> References: <20040420015638.A84821@staff.seccuris.com> <14522.1082452837@critter.freebsd.dk> <20040420200027.A51891@staff.seccuris.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mjPmdht4ZehXHR2" Content-Disposition: inline In-Reply-To: <20040420200027.A51891@staff.seccuris.com> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: freebsd-hackers@freebsd.org cc: Poul-Henning Kamp cc: freebsd-security@freebsd.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 11:30:23 -0000 --5mjPmdht4ZehXHR2 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 20, 2004 at 08:00:27PM +0000, Christian S.J. Peron wrote: +> Poul/group +>=20 +> The following patch makes raw sockets comply with prison IP addresses. +> Some tools such as traceroute(8) may require that the prison IP address +> be specified on the command line. I.E. +>=20 +> traceroute -s +>=20 +> Otherwise it might fail. +>=20 +> (because of this we may want to get rid of the +> create_raw_sockets MIB all together). +>=20 +> Anyway, take a gander at it (testers feedback welcome): Looks very neat! I've merge your patch to my jail work (pjd_jail perforce branch) and changed it to be usable with my multiple ips stuff. I haven't reviewed nor tested it yet. --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --5mjPmdht4ZehXHR2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAh6y6ForvXbEpPzQRArWBAKDKijJxa0MWetxMmwtuKgYgFYv6WQCgpL/W on2HykuapcHLa7EGsAhkxNM= =QbHT -----END PGP SIGNATURE----- --5mjPmdht4ZehXHR2-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 04:52:35 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D75316A4CE; Thu, 22 Apr 2004 04:52:35 -0700 (PDT) Received: from sev.net.ua (sev.net.ua [212.86.233.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DF9243D1D; Thu, 22 Apr 2004 04:52:32 -0700 (PDT) (envelope-from shadow@psoft.net) Received: from berloga.shadowland ([213.227.237.65]) by sev.net.ua (8.12.10/8.12.9) with ESMTP id i3MBqTv0059690; Thu, 22 Apr 2004 14:52:29 +0300 (EEST) (envelope-from shadow@psoft.net) Received: from berloga.shadowland (berloga.shadowland [127.0.0.1]) by berloga.shadowland (8.12.10/8.12.10) with ESMTP id i3MBqTba003025; Thu, 22 Apr 2004 14:52:29 +0300 Received: (from root@localhost) by berloga.shadowland (8.12.10/8.12.10/Submit) id i3MBqSWN003023; Thu, 22 Apr 2004 14:52:28 +0300 From: Alex Lyashkov To: Pawel Jakub Dawidek In-Reply-To: <20040422113002.GW24376@darkness.comp.waw.pl> References: <20040420015638.A84821@staff.seccuris.com> <14522.1082452837@critter.freebsd.dk> <20040420200027.A51891@staff.seccuris.com> <20040422113002.GW24376@darkness.comp.waw.pl> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Organization: PSoft Message-Id: <1082634747.8239.39.camel@berloga.shadowland> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-1) Date: Thu, 22 Apr 2004 14:52:28 +0300 cc: freebsd-hackers@FreeBSD.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 11:52:35 -0000 =F7 =FE=D4=D7, 22.04.2004, =D7 14:30, Pawel Jakub Dawidek =D0=C9=DB=C5=D4: > On Tue, Apr 20, 2004 at 08:00:27PM +0000, Christian S.J. Peron wrote: > +> Poul/group > +>=20 > +> The following patch makes raw sockets comply with prison IP addresses. > +> Some tools such as traceroute(8) may require that the prison IP addres= s > +> be specified on the command line. I.E. > +>=20 > +> traceroute -s > +>=20 > +> Otherwise it might fail. > +>=20 > +> (because of this we may want to get rid of the > +> create_raw_sockets MIB all together). > +>=20 > +> Anyway, take a gander at it (testers feedback welcome): >=20 > Looks very neat! I've merge your patch to my jail work (pjd_jail perforce > branch) and changed it to be usable with my multiple ips stuff. > I haven't reviewed nor tested it yet. You don`t plain do port vimage to -current ? --=20 Alex Lyashkov PSoft From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 04:45:55 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A55A16A4CE; Thu, 22 Apr 2004 04:45:55 -0700 (PDT) Received: from sev.net.ua (sev.net.ua [212.86.233.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 39E4743D55; Thu, 22 Apr 2004 04:45:53 -0700 (PDT) (envelope-from umka@sevinter.net) Received: from berloga.shadowland ([213.227.237.65]) by sev.net.ua (8.12.10/8.12.9) with ESMTP id i3MBjpv0059667; Thu, 22 Apr 2004 14:45:51 +0300 (EEST) (envelope-from umka@sevinter.net) Received: from berloga.shadowland (berloga.shadowland [127.0.0.1]) by berloga.shadowland (8.12.10/8.12.10) with ESMTP id i3MBjpba030091; Thu, 22 Apr 2004 14:45:51 +0300 Received: (from root@localhost) by berloga.shadowland (8.12.10/8.12.10/Submit) id i3MBjp3K030089; Thu, 22 Apr 2004 14:45:51 +0300 From: Alex Lyashkov To: Pawel Jakub Dawidek In-Reply-To: <20040422113002.GW24376@darkness.comp.waw.pl> References: <20040420015638.A84821@staff.seccuris.com> <14522.1082452837@critter.freebsd.dk> <20040420200027.A51891@staff.seccuris.com> <20040422113002.GW24376@darkness.comp.waw.pl> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable Organization: Home Message-Id: <1082634351.8239.36.camel@berloga.shadowland> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-1) Date: Thu, 22 Apr 2004 14:45:51 +0300 X-Mailman-Approved-At: Thu, 22 Apr 2004 05:17:06 -0700 cc: freebsd-hackers@FreeBSD.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 11:45:55 -0000 =F7 =FE=D4=D7, 22.04.2004, =D7 14:30, Pawel Jakub Dawidek =D0=C9=DB=C5=D4: > On Tue, Apr 20, 2004 at 08:00:27PM +0000, Christian S.J. Peron wrote: > +> Poul/group > +>=20 > +> The following patch makes raw sockets comply with prison IP addresses. > +> Some tools such as traceroute(8) may require that the prison IP addres= s > +> be specified on the command line. I.E. > +>=20 > +> traceroute -s > +>=20 > +> Otherwise it might fail. > +>=20 > +> (because of this we may want to get rid of the > +> create_raw_sockets MIB all together). > +>=20 > +> Anyway, take a gander at it (testers feedback welcome): >=20 > Looks very neat! I've merge your patch to my jail work (pjd_jail perforce > branch) and changed it to be usable with my multiple ips stuff. > I haven't reviewed nor tested it yet. You can`t do port vimage to -current? --=20 Alex Lyashkov Home From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 06:10:40 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A4EB416A4CE for ; Thu, 22 Apr 2004 06:10:40 -0700 (PDT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id E719743D4C for ; Thu, 22 Apr 2004 06:10:39 -0700 (PDT) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i3MDFDnq068441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 22 Apr 2004 16:15:15 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.12.11/8.12.11) id i3MDAeg1009439; Thu, 22 Apr 2004 16:10:40 +0300 (EEST) (envelope-from ru) Date: Thu, 22 Apr 2004 16:10:40 +0300 From: Ruslan Ermilov To: GiZmen Message-ID: <20040422131040.GB9359@ip.net.ua> References: <20040422095415.GA31126@blurp.one.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="R3G7APHDIzY6R/pk" Content-Disposition: inline In-Reply-To: <20040422095415.GA31126@blurp.one.pl> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-hackers@freebsd.org Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 13:10:40 -0000 --R3G7APHDIzY6R/pk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 22, 2004 at 11:54:15AM +0200, GiZmen wrote: > Hello, > =20 > Is there any way to change ttl of incoming packet to a lower value ? > I had tried min-ttl option in pf packet filter but this option only incre= ase > ttl to a given value when ttl is lower than this value. > =20 > I have searched on google and mailing lists but i do not find any answer. > I am running Freebsd 5.2.1 and i am using pf as my packet filter. > =20 You mean, make the IP forwarding decrement the IP TTL more than by one? Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --R3G7APHDIzY6R/pk Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAh8RQUkv4P6juNwoRAgs6AJ9vmt1aEgdf/tZTjWob2RLTpH2L2gCcCHsm BQnZpUUrX4MuxkxGcyxEZDI= =/9MK -----END PGP SIGNATURE----- --R3G7APHDIzY6R/pk-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 07:30:41 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BE7716A4CE for ; Thu, 22 Apr 2004 07:30:41 -0700 (PDT) Received: from ns1.interbgc.com (mail.interbgc.com [217.9.224.3]) by mx1.FreeBSD.org (Postfix) with SMTP id E779943D3F for ; Thu, 22 Apr 2004 07:30:39 -0700 (PDT) (envelope-from nike_d@cytexbg.com) Received: (qmail 27647 invoked from network); 22 Apr 2004 14:30:37 -0000 Received: from nike_d@cytexbg.com by keeper.interbgc.com by uid 1002 with qmail-scanner-1.14 (uvscan: v4.1.60/v4335. spamassassin: 2.63. Clear:SA:0(-4.9/8.0):. Processed in 1.640775 secs); 22 Apr 2004 14:30:37 -0000 X-Spam-Status: No, hits=-4.9 required=8.0 Received: from 213-240-206-214.ddns.cablebg.net (HELO tormentor.totalterror.net) (213.240.206.214) by mail.interbgc.com with SMTP; 22 Apr 2004 14:30:35 -0000 Received: (qmail 9559 invoked by uid 1006); 22 Apr 2004 14:35:02 -0000 Received: from nike_d@cytexbg.com by tormentor.cytexbg.com by uid 1003 with qmail-scanner-1.15 (sweep: 2.14/3.62. Clear:. Processed in 2.848416 secs); 22 Apr 2004 14:35:02 -0000 Received: from unknown (HELO phobos.totalterror.net) (10.0.0.6) by tormentor.totalterror.net with SMTP; 22 Apr 2004 14:34:59 -0000 References: <20040422095415.GA31126@blurp.one.pl> <20040422131040.GB9359@ip.net.ua> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Niki Denev To: Ruslan Ermilov Date: Thu, 22 Apr 2004 17:30:35 +0300 Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_mimegpg-phobos.totalterror.net-739-1082644235-0001"; micalg=pgp-sha1; protocol="application/pgp-signature" cc: freebsd-hackers@freebsd.org cc: GiZmen Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 14:30:41 -0000 This is a MIME GnuPG-signed message. If you see this text, it means that your E-mail or Usenet software does not support MIME signed messages. --=_mimegpg-phobos.totalterror.net-739-1082644235-0001 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit Ruslan Ermilov writes: > On Thu, Apr 22, 2004 at 11:54:15AM +0200, GiZmen wrote: >> Hello, >> >> Is there any way to change ttl of incoming packet to a lower value ? >> I had tried min-ttl option in pf packet filter but this option only increase >> ttl to a given value when ttl is lower than this value. >> >> I have searched on google and mailing lists but i do not find any answer. >> I am running Freebsd 5.2.1 and i am using pf as my packet filter. >> > You mean, make the IP forwarding decrement the IP TTL more than by one? > > > Cheers, > -- > Ruslan Ermilov > ru@FreeBSD.org > FreeBSD committer i've seen some cable/dsl ips's to do this, they set the IP TTL to 1 on the downlink to the client. (as a lame attempt to stop people sharing their connection) So if one put some sort of gateway on the dsl/cable modem, all the packets it receives are with IP TTL 1, and the gateway will not able to forward them to the internal network....... which is in my opinion 1-st ugly, and 2-nd, easily avoidable with min-ttl for example :) but if pf has min-ttl it seems that max-ttl can be easily added. also i think i've seen somewhere on the net a netgraph module that can modify ttl's and some other things. i think it's name was ng_mangle --niki --=_mimegpg-phobos.totalterror.net-739-1082644235-0001 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAh9cLHNAJ/fLbfrkRAkWXAKC0ZI5aGRoN1eLKjpOq8935IpSqCwCeIT2S 1xLP0e2LZUkCGlY2pW787to= =klBq -----END PGP SIGNATURE----- --=_mimegpg-phobos.totalterror.net-739-1082644235-0001-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 11:35:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 223F616A4CE for ; Thu, 22 Apr 2004 11:35:26 -0700 (PDT) Received: from staff.seccuris.com (staff.seccuris.com [204.112.0.40]) by mx1.FreeBSD.org (Postfix) with SMTP id 207D943D48 for ; Thu, 22 Apr 2004 11:35:25 -0700 (PDT) (envelope-from cperon-list@seccuris.com) Received: (qmail 24252 invoked by uid 1006); 22 Apr 2004 18:35:24 -0000 Date: Thu, 22 Apr 2004 18:35:24 +0000 From: "Christian S.J. Peron" To: Poul-Henning Kamp Message-ID: <20040422183523.A22252@staff.seccuris.com> References: <20040420200027.A51891@staff.seccuris.com> <23453.1082492678@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <23453.1082492678@critter.freebsd.dk>; from phk@phk.freebsd.dk on Tue, Apr 20, 2004 at 10:24:38PM +0200 cc: freebsd-hackers@freebsd.org cc: freebsd-security@freebsd.org Subject: Re: [patch] Raw sockets in jails X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 18:35:26 -0000 I discovered the reason why traceroute breaks without -s with the most recent patches I posted to the list. When traceroute can not figure out what its source IP address is, it generates a RTM_GET routing request through a routing socket and extracts the source address of the route given the destination. I have created a new set of patches, the only real difference is I modified the routing code so that when it receives a RTM_GET request from a jailed process, it re-defines the source address of the route so that it corresponds with the prisons IP. I have tested these patches and they appear to work, however I ask for people to test and scrutinize these patches. Feedback/comments are welcome. Regards Christian S.J. Peron --------> new and improved patch <----------- --- sys/kern/kern_jail.c.bak Mon Apr 19 16:55:40 2004 +++ sys/kern/kern_jail.c Mon Apr 19 17:56:03 2004 @@ -53,6 +53,11 @@ &jail_sysvipc_allowed, 0, "Processes in jail can use System V IPC primitives"); +int jail_allow_raw_sockets = 0; +SYSCTL_INT(_security_jail, OID_AUTO, allow_raw_sockets, CTLFLAG_RW, + &jail_allow_raw_sockets, 0, + "Prison root can create raw sockets"); + /* allprison, lastprid, and prisoncount are protected by allprison_mtx. */ struct prisonlist allprison; struct mtx allprison_mtx; --- sys/net/rtsock.c.bak Wed Apr 21 03:09:41 2004 +++ sys/net/rtsock.c Thu Apr 22 17:37:42 2004 @@ -52,6 +52,8 @@ #include #include +#include + MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); /* NB: these are not modified */ @@ -289,6 +291,7 @@ int len, error = 0; struct ifnet *ifp = 0; struct ifaddr *ifa = 0; + struct sockaddr_in jail; #define senderr(e) { error = e; goto flush;} if (m == 0 || ((m->m_len < sizeof(long)) && @@ -400,8 +403,14 @@ ifp = rt->rt_ifp; if (ifp) { info.rti_info[RTAX_IFP] = TAILQ_FIRST(&ifp->if_addrhead)->ifa_addr; - info.rti_info[RTAX_IFA] = - rt->rt_ifa->ifa_addr; + if (so->so_cred->cr_prison) { + jail.sin_family = PF_INET; + jail.sin_len = sizeof(jail); + jail.sin_addr.s_addr = htonl(so->so_cred->cr_prison->pr_ip); + info.rti_info[RTAX_IFA] = (struct sockaddr *)&jail; + } else + info.rti_info[RTAX_IFA] = + rt->rt_ifa->ifa_addr; if (ifp->if_flags & IFF_POINTOPOINT) info.rti_info[RTAX_BRD] = rt->rt_ifa->ifa_dstaddr; --- sys/netinet/raw_ip.c.b Mon Apr 19 16:23:57 2004 +++ sys/netinet/raw_ip.c Thu Apr 22 18:30:42 2004 @@ -40,6 +40,7 @@ #include "opt_random_ip_id.h" #include +#include #include #include #include @@ -215,6 +216,10 @@ if (inp->inp_faddr.s_addr && inp->inp_faddr.s_addr != ip->ip_src.s_addr) goto docontinue; + if (inp->inp_socket->so_cred->cr_prison) + if (htonl(inp->inp_socket->so_cred->cr_prison->pr_ip) + != ip->ip_dst.s_addr) + goto docontinue; if (last) { struct mbuf *n; @@ -270,7 +275,11 @@ ip->ip_off = 0; ip->ip_p = inp->inp_ip_p; ip->ip_len = m->m_pkthdr.len; - ip->ip_src = inp->inp_laddr; + if (inp->inp_socket->so_cred->cr_prison) + ip->ip_src.s_addr = + htonl(inp->inp_socket->so_cred->cr_prison->pr_ip); + else + ip->ip_src = inp->inp_laddr; ip->ip_dst.s_addr = dst; ip->ip_ttl = inp->inp_ip_ttl; } else { @@ -279,6 +288,13 @@ return(EMSGSIZE); } ip = mtod(m, struct ip *); + if (inp->inp_socket->so_cred->cr_prison) { + if (ip->ip_src.s_addr != + htonl(inp->inp_socket->so_cred->cr_prison->pr_ip)) { + m_freem(m); + return (EPERM); + } + } /* don't allow both user specified and setsockopt options, and don't allow packet length sizes that will crash */ if (((ip->ip_hl != (sizeof (*ip) >> 2)) @@ -505,6 +521,7 @@ } } +extern int jail_allow_raw_sockets; u_long rip_sendspace = RIPSNDQ; u_long rip_recvspace = RIPRCVQ; @@ -527,7 +544,11 @@ INP_INFO_WUNLOCK(&ripcbinfo); return EINVAL; } - if (td && (error = suser(td)) != 0) { + if (td && jailed(td->td_ucred) && !jail_allow_raw_sockets) { + INP_INFO_WUNLOCK(&ripcbinfo); + return (EPERM); + } + if (td && (error = suser_cred(td->td_ucred, PRISON_ROOT)) != 0) { INP_INFO_WUNLOCK(&ripcbinfo); return error; } @@ -626,6 +647,15 @@ if (nam->sa_len != sizeof(*addr)) return EINVAL; + + if (td->td_ucred->cr_prison) { + if (addr->sin_addr.s_addr == INADDR_ANY) + addr->sin_addr.s_addr = + htonl(td->td_ucred->cr_prison->pr_ip); + if (htonl(td->td_ucred->cr_prison->pr_ip) + != addr->sin_addr.s_addr) + return (EADDRNOTAVAIL); + } if (TAILQ_EMPTY(&ifnet) || (addr->sin_family != AF_INET && addr->sin_family != AF_IMPLINK) || From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 13:50:57 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2116216A4CE for ; Thu, 22 Apr 2004 13:50:57 -0700 (PDT) Received: from smtp.dkm.cz (smtp.dkm.cz [62.24.64.34]) by mx1.FreeBSD.org (Postfix) with SMTP id B190843D31 for ; Thu, 22 Apr 2004 13:50:55 -0700 (PDT) (envelope-from neuhauser@chello.cz) Received: (qmail 17430 invoked by uid 0); 22 Apr 2004 20:50:54 -0000 Received: from r3al16.mistral.cz (HELO isis.wad.cz) (213.220.229.16) by smtp.dkm.cz with SMTP; 22 Apr 2004 20:50:54 -0000 Received: by isis.wad.cz (Postfix, from userid 1001) id 3885D2FDA01; Thu, 22 Apr 2004 22:50:54 +0200 (CEST) Date: Thu, 22 Apr 2004 22:50:53 +0200 From: Roman Neuhauser To: markm@FreeBSD.ORG Message-ID: <20040422205053.GA562@isis.wad.cz> Mail-Followup-To: markm@FreeBSD.ORG, freebsd-hackers References: <20040421234458.GA37208@isis.wad.cz> <200404220702.i3M724In042266@grimreaper.grondar.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404220702.i3M724In042266@grimreaper.grondar.org> User-Agent: Mutt/1.5.6i cc: freebsd-hackers Subject: Re: panic: random.ko X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 20:50:57 -0000 # markm@FreeBSD.ORG / 2004-04-22 08:02:04 +0100: > Roman Neuhauser writes: > > > Did you type the exact THREE commands as shown above? > > > > Of course, it's been three weeks since I had that problem so I > > would be insane to claim I have exact recollection. I might have > > been typing > > > > unload > > boot /boot/kernel/kernel > > > > over and over again in an attempt to convince myself that I had made > > a typo, but I doubt that. Nevertheless, would that make a difference? > > Yes. Indeed, booting GENERIC with unload load kernel boot (or load /boot/kernel/kernel) works now, and would have worked then if I didn't screw up somehow. Sorry for the waste of time. -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 17:34:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEC1116A4CE for ; Thu, 22 Apr 2004 17:34:26 -0700 (PDT) Received: from blurp.one.pl (blurp.t4.ds.pwr.wroc.pl [156.17.226.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6963943D41 for ; Thu, 22 Apr 2004 17:34:26 -0700 (PDT) (envelope-from gizmen@blurp.one.pl) Received: by blurp.one.pl (Postfix, from userid 1001) id 10CEEA5B; Fri, 23 Apr 2004 02:34:22 +0200 (CEST) Date: Fri, 23 Apr 2004 02:34:21 +0200 From: GiZmen To: freebsd-hackers@freebsd.org Message-ID: <20040423003421.GB39351@blurp.one.pl> References: <20040422095415.GA31126@blurp.one.pl> <20040422131040.GB9359@ip.net.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 00:34:27 -0000 > >> > >>Is there any way to change ttl of incoming packet to a lower value ? > >>I had tried min-ttl option in pf packet filter but this option only > >>increase > >>ttl to a given value when ttl is lower than this value. > >> > >>I have searched on google and mailing lists but i do not find any answer. > >>I am running Freebsd 5.2.1 and i am using pf as my packet filter. > >> > >You mean, make the IP forwarding decrement the IP TTL more than by one? > i've seen some cable/dsl ips's to do this, they set the IP TTL to 1 on the > downlink to the client. (as a lame attempt to stop people sharing their > connection) > So if one put some sort of gateway on the dsl/cable modem, all > the packets it receives are with IP TTL 1, and the gateway will not able to > forward them to the internal network....... which is in my opinion > 1-st ugly, and 2-nd, easily avoidable with min-ttl for example :) > but if pf has min-ttl it seems that max-ttl can be easily added. > also i think i've seen somewhere on the net a netgraph module that can > modify ttl's and some other things. i think it's name was ng_mangle ---end quoted text--- Yes true i saw some gateways that use this trick too and that was my inspiration to look around how it can be done. But i didnt found any option to do that. max-ttl option would be a good idea to add to pf :) So there is no posibility to change ttl with kernel or some other tool. So how this dsl/cable modem gateways change theirs ttl to 1? thx -- Best Regards: GiZmen UNIX is user-friendly; it's just picky about its friends UNIX is simple; it just takes a genius to understand its simplicity From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 18:07:21 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6585216A4CF for ; Thu, 22 Apr 2004 18:07:21 -0700 (PDT) Received: from blurp.one.pl (blurp.t4.ds.pwr.wroc.pl [156.17.226.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2B42C43D3F for ; Thu, 22 Apr 2004 18:07:21 -0700 (PDT) (envelope-from gizmen@blurp.one.pl) Received: by blurp.one.pl (Postfix, from userid 1001) id 20742A47; Fri, 23 Apr 2004 02:27:00 +0200 (CEST) Date: Fri, 23 Apr 2004 02:27:00 +0200 From: GiZmen To: freebsd-hackers@freebsd.org Message-ID: <20040423002700.GA39351@blurp.one.pl> References: <20040422095415.GA31126@blurp.one.pl> <20040422131040.GB9359@ip.net.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040422131040.GB9359@ip.net.ua> User-Agent: Mutt/1.5.6i Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 01:07:21 -0000 > On Thu, Apr 22, 2004 at 11:54:15AM +0200, GiZmen wrote: > > Hello, > > > > Is there any way to change ttl of incoming packet to a lower value ? > > I had tried min-ttl option in pf packet filter but this option only increase > > ttl to a given value when ttl is lower than this value. > > > > I have searched on google and mailing lists but i do not find any answer. > > I am running Freebsd 5.2.1 and i am using pf as my packet filter. > > > You mean, make the IP forwarding decrement the IP TTL more than by one? ---end quoted text--- No, i want to change ttl to whatever value i want. For example i want to changle ttl value for any packet incoming to my iface to 10 value. I only want to know that is there some tool or option or anything else to set this. -- Best Regards: GiZmen UNIX is user-friendly; it's just picky about its friends UNIX is simple; it just takes a genius to understand its simplicity From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 18:22:31 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02E4F16A4CE for ; Thu, 22 Apr 2004 18:22:31 -0700 (PDT) Received: from mxsf30.cluster1.charter.net (mxsf30.cluster1.charter.net [209.225.28.230]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5360043D55 for ; Thu, 22 Apr 2004 18:22:30 -0700 (PDT) (envelope-from ups@tree.com) Received: from stups.com ([209.187.143.11])i3N14VLg079511; Thu, 22 Apr 2004 21:04:31 -0400 (EDT) Received: from tree.com (localhost [127.0.0.1]) by stups.com (8.9.3/8.9.3) with ESMTP id VAA18066; Thu, 22 Apr 2004 21:03:44 -0400 Message-Id: <200404230103.VAA18066@stups.com> X-Mailer: exmh version 2.0.2 To: Matthew Dillon In-Reply-To: Message from Matthew Dillon <200404220348.i3M3merS097986@apollo.backplane.com> Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_19325457060" Date: Thu, 22 Apr 2004 21:03:44 -0400 From: Stephan Uphoff cc: hackers@freebsd.org cc: Julian Elischer cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 01:22:31 -0000 This is a multipart MIME message. --==_Exmh_19325457060 Content-Type: text/plain; charset=us-ascii Matthew Dillon wrote: > :Yes - but FreeBSD then calls vm_object_page_remove to remove the pages > :from the vnode object. (vm_object_sync for 5.x or vm_map_clean for 4.x ) > < ... SNIP ...> > > I don't quite see that. Could you point out the code in question? > (And, of course, a test program would tell us for sure whether that > hole exists). There are two different things being removed... the > page table entries are removed from pmap via the vm_map for the process, > and the pages in the underlying object are being cleaned. > > Just removing pages from a pmap will not destroy the underlying pages. > For 4.X msync() -> vm_map_clean() -> vm_object_page_remove() 4.X vm_map_clean() .... if (object && invalidate && ((object->type == OBJT_VNODE) || (object->type == OBJT_DEVICE))) { vm_object_reference(object); vm_object_page_remove(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), FALSE); vm_object_deallocate(object); } ... For 5.X (current) msync() -> vm_map_sync() -> vm_object_sync() -> vm_object_page_remove() vm_object_page_remove() in 4.X and 5.X calls vm_page_free() for pages that are not wired and zeroes p->valid for wired pages. Unfortunately this does not play well together with the buffer layer (vfs_bio.c). The layer caches vmio buffers and as such will keep the pages wired. On a cache hit it does not check if the pages of the vmio buffer are still valid. ( See test program "timetravel" why I consider this a bug) This means that a normal file read() or write() access using these buffers will act on pages marked invalid. However accesses through the mmap interface will encounter the invalid pages and force a reload. I wrote a few (throw away) test programs attached below. uncache.c: mmap()s a file and calls msync(...MS_INVALIDATE..) pagetouch.c: mmap()s a file and reads the first byte from every page to force the pages to load/reload. (and prints out the char sum of all the bytes) timetravel.c: shows an example on how the current vmio/msync interaction can cause interesting problems. Try the following: dd if=/dev/zero of=testfile bs=8k count=32768 time ./pagetouch testfile time ./pagetouch testfile ./uncache testfile time ./pagetouch testfile time ./pagetouch testfile Run "./timetravel testfile2" and look at the source to see some problems caused by the vmio/msync interaction bug. For the original problem the sequence (./uncache file ; ./pagetouch file) reloads all file data from stable storage. All programs were tested on 5.2.1 Stephan PS: Postponing send-pr for a few days. --==_Exmh_19325457060 Content-Type: text/plain ; name="uncache.c"; charset=us-ascii Content-Description: uncache.c Content-Disposition: attachment; filename="uncache.c" #include #include #include #include #include #include #define MMAP_MAX_SIZE (1024 * 1024 * 128) int main(int argc, char *argv[], char *envp[]) { int fd; char* filename; void* addr; off_t size,todo,offset; struct stat stat; int status; if (argc != 2) { printf("Usage: %s \n",argv[0]); exit(1); } filename = argv[1]; fd = open(filename,O_RDWR); if (fd < 0) { perror("Open failed"); exit(1); } status = fstat(fd,&stat); if (status < 0) { perror("fstat failed"); exit(1); } size = stat.st_size; offset = 0; while(offset < size) { todo = size - offset; todo = (todo < MMAP_MAX_SIZE) ? todo : MMAP_MAX_SIZE; addr = mmap(NULL,(size_t) todo,PROT_WRITE | PROT_READ,MAP_SHARED,fd,offset); if (addr == NULL) { perror("mmap failed"); exit(1); } status = msync(addr,(size_t) todo,MS_SYNC | MS_INVALIDATE); if (status < 0) { perror("msync failed"); exit(1); } status = munmap(addr,(size_t) todo); if (status < 0) { perror("munmap failed"); exit(1); } offset += todo; } status = close(fd); if (status < 0) { perror("close failed"); exit(1); } exit(0); } --==_Exmh_19325457060 Content-Type: text/plain ; name="pagetouch.c"; charset=us-ascii Content-Description: pagetouch.c Content-Disposition: attachment; filename="pagetouch.c" #include #include #include #include #include #include #define MMAP_MAX_SIZE (1024 * 1024 * 128) int main(int argc, char *argv[], char *envp[]) { int fd; char* filename; void* addr; off_t size,todo,offset; struct stat stat; int status; char *c; char s; int pagesize; int addrOffset; if (argc != 2) { printf("Usage: %s \n",argv[0]); exit(1); } filename = argv[1]; fd = open(filename,O_RDWR); if (fd < 0) { perror("Open failed"); exit(1); } status = fstat(fd,&stat); if (status < 0) { perror("fstat failed"); exit(1); } size = stat.st_size; offset = 0; pagesize = getpagesize(); while(offset < size) { todo = size - offset; todo = (todo < MMAP_MAX_SIZE) ? todo : MMAP_MAX_SIZE; addr = mmap(NULL,(size_t) todo,PROT_WRITE | PROT_READ,MAP_SHARED,fd,offset); if (addr == NULL) { perror("mmap failed"); exit(1); } c = addr; addrOffset = 0; while(addrOffset < todo) { s += *(c + addrOffset); addrOffset += pagesize; } status = munmap(addr,(size_t) todo); if (status < 0) { perror("munmap failed"); exit(1); } offset += todo; } status = close(fd); if (status < 0) { perror("close failed"); exit(1); } printf("Sum=%d\n",(int) s); exit(0); } --==_Exmh_19325457060 Content-Type: text/plain ; name="timetravel.c"; charset=us-ascii Content-Description: timetravel.c Content-Disposition: attachment; filename="timetravel.c" #include #include #include #include #include #include void writeString(int fd,int old) { int status; off_t offset; offset = lseek(fd, (off_t) 0, SEEK_SET); if (offset == -1) { perror("seek to start failed"); exit(1); } status = write(fd,(old) ? "old" : "new" ,3); if (status < 0) { perror("Write failed"); exit(1); } if(status != 3) { fprintf(stderr,"Write truncated"); exit(1); } printf("Writing %s\n", (old) ? "old" : "new"); } void readString(int fd) { int status; off_t offset; char buffer[3]; offset = lseek(fd, (off_t) 0, SEEK_SET); if (offset == -1) { perror("seek to start failed"); exit(1); } status = read(fd,buffer,3); if (status < 0) { perror("Write failed"); exit(1); } if(status != 3) { fprintf(stderr,"read truncated"); exit(1); } printf("Read result=%3.3s\n",buffer); } int main(int argc, char *argv[], char *envp[]) { int fd1,fd2; char* filename; void* addr; off_t size,todo,offset; struct stat stat; int status; char buffer[3]; if (argc != 2) { printf("Usage: %s \n",argv[0]); exit(1); } filename = argv[1]; fd1 = open(filename,O_RDWR | O_CREAT | O_TRUNC,0666); if (fd1 < 0) { perror("Open failed"); exit(1); } writeString(fd1, 1 /* old */); status = fsync(fd1); if (status < 0) { perror("fsync failed"); exit(1); } readString(fd1); writeString(fd1, 0 /* new */); readString(fd1); /* This open/mmap/msync/pagein could run in another program with credentials that only allow read access to the file */ fd2 = open(filename,O_RDONLY); if (fd2 < 0) { perror("Open 2 failed"); exit(1); } addr = mmap(NULL,(size_t) 3, PROT_READ ,MAP_SHARED,fd2,0); if (addr == NULL) { perror("mmap failed"); exit(1); } status = msync(addr,(size_t) 3,MS_SYNC | MS_INVALIDATE); if (status < 0) { perror("msync failed"); exit(1); } printf("Called msync()\n"); readString(fd1); printf("mmaped result= %3.3s\n",(char*) addr); readString(fd1); exit(0); } --==_Exmh_19325457060-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 18:27:53 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5230616A514 for ; Thu, 22 Apr 2004 18:27:53 -0700 (PDT) Received: from mailtoaster1.pipeline.ch (mailtoaster1.pipeline.ch [62.48.0.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7802F43D58 for ; Thu, 22 Apr 2004 18:27:50 -0700 (PDT) (envelope-from andre@freebsd.org) Received: (qmail 24205 invoked from network); 23 Apr 2004 01:27:49 -0000 Received: from unknown (HELO freebsd.org) ([62.48.0.47]) (envelope-sender ) by mailtoaster1.pipeline.ch (qmail-ldap-1.03) with SMTP for ; 23 Apr 2004 01:27:49 -0000 Message-ID: <40887114.7000700@freebsd.org> Date: Fri, 23 Apr 2004 03:27:48 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040316 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <39FE23FA-7F75-11D8-8F99-000A95CDA38A@webweaving.org> <20040327175645.GC90316@empiric.dek.spc.org> <200403271918.18032.vjardin@free.fr> In-Reply-To: <200403271918.18032.vjardin@free.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Vincent Jardin cc: Dirk-Willem van Gulik cc: wpaul@freebsd.org Subject: Re: events when (de)associating or when cable is (un)plugged X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 01:27:53 -0000 Ok, I tried to implement this tonight but it doesn't work in FreeBSD. I don't get any notification when the cable is unplugged or plugged. I don't get it, maybe someone else sees it, I don't. miibus_linkchg gets called pretty frequently but the detection logic seems to be flawed. For some reason it doesn't detect cable changes. When I change the media with ifconfig from auto to 100BaseTX and back it reports correctly. Tested with fxp and bge interfaces. In OpenBSD it works perfectly (fxp interface). Unplug cable, message comes up, plug cable, message comes up. I can't see any logical difference between OpenBSD/NetBSD and or MII variant. -- Andre Index: dev/mii/mii.c =================================================================== RCS file: /home/ncvs/src/sys/dev/mii/mii.c,v retrieving revision 1.17 diff -u -p -r1.17 mii.c --- dev/mii/mii.c 24 Aug 2003 17:54:10 -0000 1.17 +++ dev/mii/mii.c 23 Apr 2004 01:16:06 -0000 @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD: src/sys/dev/mii/mii. #include #include +#include #include #include @@ -237,7 +238,7 @@ miibus_linkchg(dev) struct mii_data *mii; struct ifnet *ifp; device_t parent; - int link; + int link, link_state; parent = device_get_parent(dev); MIIBUS_LINKCHG(parent); @@ -249,15 +250,25 @@ miibus_linkchg(dev) ifp = device_get_softc(parent); if (mii->mii_media_status & IFM_AVALID) { - if (mii->mii_media_status & IFM_ACTIVE) + if (mii->mii_media_status & IFM_ACTIVE) { link = NOTE_LINKUP; - else + link_state = LINK_STATE_UP; + } else { link = NOTE_LINKDOWN; + link_state = LINK_STATE_DOWN; + } } else { link = NOTE_LINKINV; + link_state = LINK_STATE_UNKNOWN; } KNOTE(&ifp->if_klist, link); + + /* Notify protocols that the link state has changed */ + if (link_state != ifp->if_link_state) { + ifp->if_link_state = link_state; + rt_ifmsg(ifp); + } } static void Index: net/if.h =================================================================== RCS file: /home/ncvs/src/sys/net/if.h,v retrieving revision 1.85 diff -u -p -r1.85 if.h --- net/if.h 11 Apr 2004 13:36:52 -0000 1.85 +++ net/if.h 23 Apr 2004 01:16:06 -0000 @@ -104,6 +104,7 @@ struct if_data { u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ u_char ifi_addrlen; /* media address length */ u_char ifi_hdrlen; /* media header length */ + u_char ifi_link_state; /* current link state */ u_char ifi_recvquota; /* polling quota for receive intrs */ u_char ifi_xmitquota; /* polling quota for xmit intrs */ u_long ifi_mtu; /* maximum transmission unit */ @@ -153,6 +154,13 @@ struct if_data { (IFF_BROADCAST|IFF_POINTOPOINT|IFF_RUNNING|IFF_OACTIVE|\ IFF_SIMPLEX|IFF_MULTICAST|IFF_ALLMULTI|IFF_SMART|IFF_PROMISC|\ IFF_POLLING) + +/* + * Values for if_link_state. + */ +#define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */ +#define LINK_STATE_DOWN 1 /* link is down */ +#define LINK_STATE_UP 2 /* link is up */ /* * Some convenience macros used for setting ifi_baudrate. Index: net/if_var.h =================================================================== RCS file: /home/ncvs/src/sys/net/if_var.h,v retrieving revision 1.73 diff -u -p -r1.73 if_var.h --- net/if_var.h 18 Apr 2004 18:59:44 -0000 1.73 +++ net/if_var.h 23 Apr 2004 01:16:06 -0000 @@ -197,6 +197,7 @@ typedef void if_init_f_t(void *); #define if_addrlen if_data.ifi_addrlen #define if_hdrlen if_data.ifi_hdrlen #define if_metric if_data.ifi_metric +#define if_link_state if_data.ifi_link_state #define if_baudrate if_data.ifi_baudrate #define if_hwassist if_data.ifi_hwassist #define if_ipackets if_data.ifi_ipackets From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 19:02:54 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0780016A4CE for ; Thu, 22 Apr 2004 19:02:54 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id DE10D43D4C for ; Thu, 22 Apr 2004 19:02:52 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004042302024701100paaeve>; Fri, 23 Apr 2004 02:02:52 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id TAA06118; Thu, 22 Apr 2004 19:02:47 -0700 (PDT) Date: Thu, 22 Apr 2004 19:02:45 -0700 (PDT) From: Julian Elischer To: GiZmen In-Reply-To: <20040423002700.GA39351@blurp.one.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 02:02:54 -0000 start with natd and chop it until you have what you want.. On Fri, 23 Apr 2004, GiZmen wrote: > > On Thu, Apr 22, 2004 at 11:54:15AM +0200, GiZmen wrote: > > > Hello, > > > > > > Is there any way to change ttl of incoming packet to a lower value ? > > > I had tried min-ttl option in pf packet filter but this option only increase > > > ttl to a given value when ttl is lower than this value. > > > > > > I have searched on google and mailing lists but i do not find any answer. > > > I am running Freebsd 5.2.1 and i am using pf as my packet filter. > > > > > You mean, make the IP forwarding decrement the IP TTL more than by one? > ---end quoted text--- > > No, i want to change ttl to whatever value i want. For example i want to > changle ttl value for any packet incoming to my iface to 10 value. > I only want to know that is there some tool or option or anything else > to set this. > > -- > Best Regards: > GiZmen > > UNIX is user-friendly; it's just picky about its friends > UNIX is simple; it just takes a genius to understand its simplicity > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 19:12:02 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98E0516A4CE for ; Thu, 22 Apr 2004 19:12:02 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 839AC43D45 for ; Thu, 22 Apr 2004 19:12:02 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3N2Bw7Z004162; Thu, 22 Apr 2004 19:12:00 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3N2Bwh6004161; Thu, 22 Apr 2004 19:11:58 -0700 (PDT) (envelope-from dillon) Date: Thu, 22 Apr 2004 19:11:58 -0700 (PDT) From: Matthew Dillon Message-Id: <200404230211.i3N2Bwh6004161@apollo.backplane.com> To: Stephan Uphoff References: <200404230103.VAA18066@stups.com> cc: hackers@freebsd.org cc: Julian Elischer Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 02:12:02 -0000 Sigh. Run this program. Note that the file contains an 'A' in the first byte after you run it (hexdump -C test.dat). Thus, msync() is not destroying the page until AFTER it finishes flushing it to disk. /* * x.c */ #include #include #include #include #include int main(int ac, char **av) { int fd; char *ptr; fd = open("test.dat", O_RDWR|O_CREAT|O_TRUNC, 0666); ftruncate(fd, 4096); ptr = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); *ptr = 'A'; msync(ptr, 4096, MS_INVALIDATE); return(0); } Now run this program. Note that the file still contains an 'A' after you run it. Thus, again, msync() is not destroying the page until after it has been synchronized with the file. I also added some additional code to re-read *ptr after the msync and observed the I/O go through to the disk, so it does appear to be destroying the page. But it is definitely flushing it to disk first. If you can demonstrate a case where the page is being destroying when it shouldn't be, then there's a bug that needs fixing. Right now though it seems to operate as expected. -Matt /* * y.c */ #include #include #include #include #include int main(int ac, char **av) { int fd; char *ptr; fd = open("test.dat", O_RDWR|O_CREAT|O_TRUNC, 0666); ftruncate(fd, 4096); ptr = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); *ptr = 'A'; munmap(ptr, 4096); ptr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0); msync(ptr, 4096, MS_INVALIDATE); return(0); } From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 19:42:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F5D616A4CE for ; Thu, 22 Apr 2004 19:42:26 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D36F43D54 for ; Thu, 22 Apr 2004 19:42:26 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3N2gO7Z004350; Thu, 22 Apr 2004 19:42:24 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3N2gOMg004349; Thu, 22 Apr 2004 19:42:24 -0700 (PDT) (envelope-from dillon) Date: Thu, 22 Apr 2004 19:42:24 -0700 (PDT) From: Matthew Dillon Message-Id: <200404230242.i3N2gOMg004349@apollo.backplane.com> To: Stephan Uphoff References: <200404230103.VAA18066@stups.com> cc: hackers@freebsd.org cc: Julian Elischer Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 02:42:26 -0000 Ok... I've done some more testing. Ahh! I finally was able to reproduce the problem with PROT_READ, and I now see the code bit you were talking about. That's definitely a bug. Here's the test program that reproduces the problem. This is definitely a serious bug. -Matt /* * y.c */ #include #include #include #include #include int main(int ac, char **av) { int fd; char *ptr1; char *ptr2; fd = open("test.dat", O_RDWR|O_CREAT|O_TRUNC, 0666); ftruncate(fd, 4096); ptr1 = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); *ptr1 = 'A'; ptr2 = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0); if (msync(ptr2, 4096, MS_INVALIDATE | MS_SYNC) < 0) perror("msync"); printf("contents of *ptr1 is %d\n", *ptr1); printf("contents of *ptr2 is %d\n", *ptr2); return(0); } From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 19:53:36 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D2D216A4CE for ; Thu, 22 Apr 2004 19:53:36 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23C4043D31 for ; Thu, 22 Apr 2004 19:53:36 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3N2rZ7Z004402; Thu, 22 Apr 2004 19:53:35 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3N2rZ0t004401; Thu, 22 Apr 2004 19:53:35 -0700 (PDT) (envelope-from dillon) Date: Thu, 22 Apr 2004 19:53:35 -0700 (PDT) From: Matthew Dillon Message-Id: <200404230253.i3N2rZ0t004401@apollo.backplane.com> To: Stephan Uphoff , Julian Elischer References: <200404230103.VAA18066@stups.com> cc: hackers@freebsd.org Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 02:53:36 -0000 (taking hackers off to reduce noise) I think all that needs to happen to fix this problem is to call vm_object_page_remove() with the clean_only flag set to TRUE instead of FALSE. Wired pages, e.g. pages in the buffer cache, will not be removed, but that's ok because memory-mapped pages tend to not get buffer cache associations until the system decides to flush the pages. Fixing the buffer cache issue would have to occur in the actual VNODE I/O operation, which would only occur for VM_PROT_WRITE operations, which I think is just fine. The I/O op will have access to the invalidation request as a flag and it can simply do what NFS does which is flag the buffer to be destroyed on I/O completion. If that is done, then by the time we get to the second pass the buffer should be gone and the vm_object_page_remove() function will find a normal, unwired page and properly remove it. I'll test this out in DragonFly and email Stephan and Julian a followup. -Matt From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 20:26:12 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D0D6716A4CE for ; Thu, 22 Apr 2004 20:26:12 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id A931143D45 for ; Thu, 22 Apr 2004 20:26:12 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3N3QB7Z004590; Thu, 22 Apr 2004 20:26:11 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3N3QBAp004589; Thu, 22 Apr 2004 20:26:11 -0700 (PDT) (envelope-from dillon) Date: Thu, 22 Apr 2004 20:26:11 -0700 (PDT) From: Matthew Dillon Message-Id: <200404230326.i3N3QBAp004589@apollo.backplane.com> To: Stephan Uphoff , Julian Elischer , hackers@freebsd.org References: <200404230103.VAA18066@stups.com> <200404230253.i3N2rZ0t004401@apollo.backplane.com> Subject: Re99: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 03:26:13 -0000 : (taking hackers off to reduce noise) oops. I guess I didn't take it off hackers. Sorry about that. Yah yah, I know, 'Matt's making a billion postings again'. In anycase, I sent a patch set to Stephan and julian, and since I didn't take it off the list like I said I would I guess I might as well post the patch set and the revised test program too for anyone following along. Note that the patch set is against DragonFly, but should easily patch into 4.x. Stephan and Julian will deal with 4.xisms and 5.xisms. The idea with the fix is as follows: * It's hard to make the VM system invalidate buffers, so don't try. Instead, make UFS recognize the IO_INVAL ioflag and mark the buffer appropriately in the putpages -> generic put pages -> VOP_WRITE() path. This only occurs if the msync'd map was writable. If the msync'd map was only readable, then the data is not flushed through the vnode system and the pages will not be removed if there happens to be a buffer associated with them, even if the buffer is clean. I think this is reasonable. Not perfect, but reasonable. * Set clean_only to TRUE when calling vm_object_page_remove(), which causes vm_object_page_remove() to ignore wired or dirty pages. This code is called for both readable and writable maps so we can't just remove the page unconditionallty, hence clean_only should be set to TRUE. This means that any pages associated with the buffer cache will NOT be removed if the map was read-only. If the map was writable, then the IO_INVAL fix above will destroy the buffer and the page should wind up not being wired any more, and thus will be properly removed. That's it! -Matt /* * y.c */ #include #include #include #include #include int main(int ac, char **av) { int fd; char *ptr1; char *ptr2; char buf[4096]; fd = open("test.dat", O_RDWR|O_CREAT|O_TRUNC, 0666); ftruncate(fd, 4096); ptr1 = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); *ptr1 = 'A'; read(fd, buf, 4096); ptr2 = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0); if (msync(ptr1, 4096, MS_INVALIDATE | MS_SYNC) < 0) perror("msync"); sleep(4); printf("contents of *ptr1 is %d\n", *ptr1); printf("contents of *ptr2 is %d\n", *ptr2); return(0); } Index: vm/vm_map.c =================================================================== RCS file: /cvs/src/sys/vm/vm_map.c,v retrieving revision 1.24 diff -u -r1.24 vm_map.c --- vm/vm_map.c 23 Mar 2004 22:54:32 -0000 1.24 +++ vm/vm_map.c 23 Apr 2004 02:56:17 -0000 @@ -2212,7 +2212,7 @@ vm_object_page_remove(object, OFF_TO_IDX(offset), OFF_TO_IDX(offset + size + PAGE_MASK), - FALSE); + TRUE); vm_object_deallocate(object); } start += size; Index: vfs/ufs/ufs_readwrite.c =================================================================== RCS file: /cvs/src/sys/vfs/ufs/ufs_readwrite.c,v retrieving revision 1.9 diff -u -r1.9 ufs_readwrite.c --- vfs/ufs/ufs_readwrite.c 26 Jul 2003 22:04:27 -0000 1.9 +++ vfs/ufs/ufs_readwrite.c 23 Apr 2004 03:05:50 -0000 @@ -531,6 +531,8 @@ bp->b_flags |= B_DIRECT; if (ioflag & IO_NOWDRAIN) bp->b_flags |= B_NOWDRAIN; + if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL)) + bp->b_flags |= B_NOCACHE; if (uio->uio_offset + xfersize > ip->i_size) { ip->i_size = uio->uio_offset + xfersize; From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 22:37:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C03916A4CE for ; Thu, 22 Apr 2004 22:37:08 -0700 (PDT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C57043D49 for ; Thu, 22 Apr 2004 22:37:07 -0700 (PDT) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i3N5febf025511 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Apr 2004 08:41:41 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.12.11/8.12.11) id i3N5b3Tw064404; Fri, 23 Apr 2004 08:37:03 +0300 (EEST) (envelope-from ru) Date: Fri, 23 Apr 2004 08:37:02 +0300 From: Ruslan Ermilov To: Julian Elischer Message-ID: <20040423053702.GD64148@ip.net.ua> References: <20040423002700.GA39351@blurp.one.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LKTjZJSUETSlgu2t" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: freebsd-hackers@FreeBSD.org cc: GiZmen Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 05:37:08 -0000 --LKTjZJSUETSlgu2t Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Apr 22, 2004 at 07:02:45PM -0700, Julian Elischer wrote: > start with natd and chop it until you have what you want.. >=20 ports/net/tcpmssd might be easier to adopt. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --LKTjZJSUETSlgu2t Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAiKt+Ukv4P6juNwoRAgjQAKCFuoRrZInKU0hf2Wq9kZkfRpHBTQCfZBFw s/A2aAd3mqYfuoDk2/JoSlo= =kv7h -----END PGP SIGNATURE----- --LKTjZJSUETSlgu2t-- From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 00:30:38 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3DEFC16A4CE for ; Fri, 23 Apr 2004 00:30:38 -0700 (PDT) Received: from sccrmhc13.comcast.net (sccrmhc13.comcast.net [204.127.202.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id E121643D45 for ; Fri, 23 Apr 2004 00:30:37 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc13) with ESMTP id <2004042307303601600d1kcke>; Fri, 23 Apr 2004 07:30:37 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id AAA00857; Fri, 23 Apr 2004 00:30:35 -0700 (PDT) Date: Fri, 23 Apr 2004 00:30:34 -0700 (PDT) From: Julian Elischer To: Matthew Dillon In-Reply-To: <200404230211.i3N2Bwh6004161@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org cc: Stephan Uphoff Subject: Re: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 07:30:38 -0000 On Thu, 22 Apr 2004, Matthew Dillon wrote: > Sigh. Run this program. Note that the file contains an 'A' in the > first byte after you run it (hexdump -C test.dat). Thus, msync() > is not destroying the page until AFTER it finishes flushing it to > disk. > > /* > * x.c > */ > #include > #include > #include > #include > #include > > int > main(int ac, char **av) > { > int fd; > char *ptr; > > fd = open("test.dat", O_RDWR|O_CREAT|O_TRUNC, 0666); > ftruncate(fd, 4096); > ptr = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); > *ptr = 'A'; > msync(ptr, 4096, MS_INVALIDATE); > return(0); > } > > Now run this program. Note that the file still contains an 'A' > after you run it. Thus, again, msync() is not destroying the page > until after it has been synchronized with the file. > > I also added some additional code to re-read *ptr after the msync > and observed the I/O go through to the disk, so it does appear to > be destroying the page. But it is definitely flushing it to disk > first. > > If you can demonstrate a case where the page is being destroying > when it shouldn't be, then there's a bug that needs fixing. Right > now though it seems to operate as expected. But this is exactly what I want.. I want any unwrittendata to be written out, and pages containing written out data to be discarded so that a reread is forced to go to disk. > > -Matt > > /* > * y.c > */ > #include > #include > #include > #include > #include > > int > main(int ac, char **av) > { > int fd; > char *ptr; > > fd = open("test.dat", O_RDWR|O_CREAT|O_TRUNC, 0666); > ftruncate(fd, 4096); > ptr = mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); > *ptr = 'A'; > munmap(ptr, 4096); > ptr = mmap(NULL, 4096, PROT_READ, MAP_SHARED, fd, 0); > msync(ptr, 4096, MS_INVALIDATE); > return(0); > } > > > From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 00:36:37 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B0BF16A4CE; Fri, 23 Apr 2004 00:36:37 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38D7043D4C; Fri, 23 Apr 2004 00:36:37 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004042307363601100pa7pce>; Fri, 23 Apr 2004 07:36:36 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id AAA00905; Fri, 23 Apr 2004 00:36:35 -0700 (PDT) Date: Fri, 23 Apr 2004 00:36:34 -0700 (PDT) From: Julian Elischer To: Ruslan Ermilov In-Reply-To: <20040423053702.GD64148@ip.net.ua> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@FreeBSD.org cc: GiZmen Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 07:36:37 -0000 yep I'd have to agree with that.. All the needed bits should already be there. On Fri, 23 Apr 2004, Ruslan Ermilov wrote: > On Thu, Apr 22, 2004 at 07:02:45PM -0700, Julian Elischer wrote: > > start with natd and chop it until you have what you want.. > > > ports/net/tcpmssd might be easier to adopt. > > > Cheers, > -- > Ruslan Ermilov > ru@FreeBSD.org > FreeBSD committer > From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 04:57:47 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FBDD16A4CF for ; Fri, 23 Apr 2004 04:57:47 -0700 (PDT) Received: from hexagon.stack.nl (hexagon.stack.nl [131.155.140.144]) by mx1.FreeBSD.org (Postfix) with ESMTP id F019343D2D for ; Fri, 23 Apr 2004 04:57:46 -0700 (PDT) (envelope-from marcolz@stack.nl) Received: from hammer.stack.nl (hammer.stack.nl [IPv6:2001:610:1108:5010::153]) by hexagon.stack.nl (Postfix) with ESMTP id 408904BA#02F30515A for ; Fri, 23 Apr 2004 13:57:46 +0200 (CEST) Received: by hammer.stack.nl (Postfix, from userid 333) id D8A866372; Fri, 23 Apr 2004 13:57:44 +0200 (CEST) Date: Fri, 23 Apr 2004 13:57:44 +0200 From: Marc Olzheim To: hackers@freebsd.org Message-ID: <20040423115744.GA27689@stack.nl> References: <20040121211344.GA97203@stack.nl> <20040121220916.GC97291@stack.nl> <20040122101641.GA82155@stack.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <20040122101641.GA82155@stack.nl> X-Operating-System: FreeBSD hammer.stack.nl 5.2-CURRENT FreeBSD 5.2-CURRENT X-URL: http://www.stack.nl/~marcolz/ User-Agent: Mutt/1.5.6i Subject: Re: libc_r/uthread/uthread_create.c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 11:57:47 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Jan 22, 2004 at 11:16:41AM +0100, Marc Olzheim wrote: > Daniel Eischen proposed a simpler patch, which does the same trick... Could this be committed in -STABLE by someone ? Or must this wait until after 4.10 ? (CURRENT: pthread_private.h -r 1.82 -r 1.81) Marc --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="pthread_ebp.patch" --- /usr/src/lib/libc_r/uthread/pthread_private.h Tue Oct 22 16:44:02 2002 +++ /usr/src/lib/libc_r/uthread/pthread_private.h Fri Apr 23 13:49:26 2004 @@ -84,7 +84,10 @@ fdata = (char *) (ucp)->uc_mcontext.mc_fpregs; \ __asm__("frstor %0": :"m"(*fdata)); \ } while (0) -#define SET_RETURN_ADDR_JB(jb, ra) (jb)[0]._jb[0] = (int)(ra) +#define SET_RETURN_ADDR_JB(jb, ra) do { \ + (jb)[0]._jb[0] = (int)(ra); \ + (jb)[0]._jb[3] = 0; \ +} while (0) #elif defined(__alpha__) #include #define GET_STACK_JB(jb) ((unsigned long)((jb)[0]._jb[R_SP + 4])) --OXfL5xGRrasGEqWY-- From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 09:32:45 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3648D16A4CE for ; Thu, 22 Apr 2004 09:32:45 -0700 (PDT) Received: from hotmail.com (bay11-f17.bay11.hotmail.com [64.4.39.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2644243D1F for ; Thu, 22 Apr 2004 09:32:45 -0700 (PDT) (envelope-from chrcoluk@msn.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 22 Apr 2004 09:32:45 -0700 Received: from 62.254.0.32 by by11fd.bay11.hotmail.msn.com with HTTP; Thu, 22 Apr 2004 16:32:44 GMT X-Originating-IP: [62.254.0.32] X-Originating-Email: [chrcoluk@msn.com] X-Sender: chrcoluk@msn.com From: "chris collins" To: hackers@FreeBSD.org Date: Thu, 22 Apr 2004 16:32:44 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 22 Apr 2004 16:32:45.0117 (UTC) FILETIME=[70C98ED0:01C42887] X-Mailman-Approved-At: Fri, 23 Apr 2004 05:17:59 -0700 Subject: kernel panicking X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2004 16:32:45 -0000 Hi I have had 3 kernel panics in 2 days, I am suspecting bad ram as before these events there was a power outage but I have done a kernel debug and here is the info I have, please let me know if you have a solution or need more info. This GDB was configured as "i386-unknown-freebsd"...Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 2627 in elfstab_build_psymtabs Deprecated bfd_read called at /usr/src/gnu/usr.bin/binutils/gdb/../../../../contrib/gdb/gdb/dbxread.c line 933 in fill_symbuf IdlePTD at phsyical address 0x00597000 initial pcb at physical address 0x004bdc40 panicstr: page fault panic messages: --- Fatal trap 12: page fault while in kernel mode fault virtual address = 0x18078500 fault code = supervisor read, page not present instruction pointer = 0x8:0xc03c01f2 stack pointer = 0x10:0xc045639c frame pointer = 0x10:0xc04563c4 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = Idle interrupt mask = trap number = 12 panic: page fault syncing disks... Fatal trap 12: page fault while in kernel mode fault virtual address = 0x30 fault code = supervisor read, page not present instruction pointer = 0x8:0xc034a7a0 stack pointer = 0x10:0xc04561c8 frame pointer = 0x10:0xc04561d0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = Idle interrupt mask = bio cam trap number = 12 panic: page fault Uptime: 18h29m8s dumping to dev #ad/0x20001, offset 1016928 dump ata0: resetting devices .. done 511 510 509 508 507 506 505 504 503 502 501 500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 482 481 480 479 478 477 476 475 474 473 472 471 470 469 468 467 466 465 464 463 462 461 460 459 458 457 456 455 454 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 432 431 430 429 428 427 426 425 424 423 422 421 420 419 418 417 416 415 414 413 412 411 410 409 408 407 406 405 404 403 402 401 400 399 398 397 396 395 394 393 392 391 390 389 388 387 386 385 384 383 382 381 380 379 378 377 376 375 374 373 372 371 370 369 368 367 366 365 364 363 362 361 360 359 358 357 356 355 354 353 352 351 350 349 348 347 346 345 344 343 342 341 340 339 338 337 336 335 334 333 332 331 330 329 328 327 326 325 324 323 322 321 320 319 318 317 316 315 314 313 312 311 310 309 308 307 306 305 304 303 302 301 300 299 298 297 296 295 294 293 292 291 290 289 288 287 286 285 284 283 282 281 280 279 278 277 276 275 274 273 272 271 270 269 268 267 266 265 264 263 262 261 260 259 258 257 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --- #0 dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487 487 if (dumping++) { (kgdb) where #0 dumpsys () at /usr/src/sys/kern/kern_shutdown.c:487 #1 0xc023e6db in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:316 #2 0xc023eb19 in panic (fmt=0xc044c8ec "%s") at /usr/src/sys/kern/kern_shutdown.c:595 #3 0xc03c169f in trap_fatal (frame=0xc0456188, eva=48) at /usr/src/sys/i386/i386/trap.c:974 #4 0xc03c134d in trap_pfault (frame=0xc0456188, usermode=0, eva=48) at /usr/src/sys/i386/i386/trap.c:867 #5 0xc03c0ef3 in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16, tf_edi = -1068663584, tf_esi = 0, tf_ebp = -1069194800, tf_isp = -1069194828, tf_ebx = -1068960644, tf_edx = 6871104, tf_ecx = 2, tf_eax = 0, tf_trapno = 12, tf_err = 0, tf_eip = -1070291040, tf_cs = 8, tf_eflags = 66050, tf_esp = 0, tf_ss = 0}) at /usr/src/sys/i386/i386/trap.c:466 #6 0xc034a7a0 in acquire_lock (lk=0xc048f47c) at /usr/src/sys/ufs/ffs/ffs_softdep.c:266 #7 0xc034edc2 in softdep_fsync_mountdev (vp=0xda938b40) at /usr/src/sys/ufs/ffs/ffs_softdep.c:4024 #8 0xc035322a in ffs_fsync (ap=0xc0456244) at /usr/src/sys/ufs/ffs/ffs_vnops.c:134 #9 0xc0351df3 in ffs_sync (mp=0xc22fb600, waitfor=2, cred=0xc1454900, p=0xc04d7ce0) at vnode_if.h:558 #10 0xc026f493 in sync (p=0xc04d7ce0, uap=0x0) at /usr/src/sys/kern/vfs_syscalls.c:577 #11 0xc023e44e in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:235 #12 0xc023eb19 in panic (fmt=0xc044c8ec "%s") at /usr/src/sys/kern/kern_shutdown.c:595 #13 0xc03c169f in trap_fatal (frame=0xc045635c, eva=403145984) at /usr/src/sys/i386/i386/trap.c:974 #14 0xc03c134d in trap_pfault (frame=0xc045635c, usermode=0, eva=403145984) at /usr/src/sys/i386/i386/trap.c:867 #15 0xc03c0ef3 in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16, tf_edi = -1036151426, tf_esi = 403145984, tf_ebp = -1069194300, tf_isp = -1069194360, tf_ebx = 92, tf_edx = 18, tf_ecx = 23, tf_eax = -1439297410, tf_trapno = 12, tf_err = 0, tf_eip = -1069809166, tf_cs = 8, tf_eflags = 66070, tf_esp = -1051967232, tf_ss = 92}) at /usr/src/sys/i386/i386/trap.c:466 #16 0xc03c01f2 in generic_bcopy () #17 0xc0280fb4 in catchpacket (d=0xc23c4e80, pkt=0xc146c500 "", pktlen=404558205, snaplen=200, cpfn=0xc0280d68 ) at /usr/src/sys/net/bpf.c:1333 #18 0xc0280e1c in bpf_mtap (ifp=0xc21dca00, m=0xc146c500) at /usr/src/sys/net/bpf.c:1255 #19 0xc0323dc9 in sis_start (ifp=0xc21dca00) at /usr/src/sys/pci/if_sis.c:1786 #20 0xc0323bb6 in sis_intr (arg=0xc21dca00) at /usr/src/sys/pci/if_sis.c:1668 #21 0xc03cbff1 in intr_mux (arg=0xc144d120) at /usr/src/sys/i386/isa/intr_machdep.c:601 #22 0xc03baf06 in cpu_idle () at /usr/src/sys/i386/i386/machdep.c:1000 _________________________________________________________________ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 17:51:00 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FC5C16A4CF for ; Thu, 22 Apr 2004 17:51:00 -0700 (PDT) Received: from web13504.mail.yahoo.com (web13504.mail.yahoo.com [216.136.175.83]) by mx1.FreeBSD.org (Postfix) with SMTP id 3E8DE43D49 for ; Thu, 22 Apr 2004 17:51:00 -0700 (PDT) (envelope-from dyeske@yahoo.com) Message-ID: <20040423005057.15006.qmail@web13504.mail.yahoo.com> Received: from [68.114.32.23] by web13504.mail.yahoo.com via HTTP; Thu, 22 Apr 2004 17:50:57 PDT Date: Thu, 22 Apr 2004 17:50:57 -0700 (PDT) From: David Yeske To: archie@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailman-Approved-At: Fri, 23 Apr 2004 05:17:59 -0700 Subject: netgraph ability X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 00:51:00 -0000 I'm in a situation where I need to emulate multiple ethernet devices with different mac addresses. I have gotten far enough to have this. I ran ngctl and then ran "mkpeer . eiface hook ether" I then ran ifconfig ngeth0 link '00:bd:03:11:21:11' ifconfig ngeth0 192.168.20.5 ifconfig sis0 192.168.23.45 So basically I want to be able to ping / connect to 192.168.20.5 from another box on the 192.168.23.0/24 network, and have it see the mac address that I have set rather than the mac address of my sis0 device. I know I can do this with vmware, but I am trying to avoid that. Anyone know if this is possible? Is there a way to do this with the tap device and or arpd? Regards, David Yeske From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 09:28:04 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF35E16A4CE for ; Fri, 23 Apr 2004 09:28:04 -0700 (PDT) Received: from blurp.one.pl (blurp.t4.ds.pwr.wroc.pl [156.17.226.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8498E43D55 for ; Fri, 23 Apr 2004 09:28:04 -0700 (PDT) (envelope-from gizmen@blurp.one.pl) Received: by blurp.one.pl (Postfix, from userid 1001) id 810A9A47; Fri, 23 Apr 2004 13:32:03 +0200 (CEST) Date: Fri, 23 Apr 2004 13:32:03 +0200 From: GiZmen To: freebsd-hackers@freebsd.org Message-ID: <20040423113203.GB41414@blurp.one.pl> References: <20040423053702.GD64148@ip.net.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 16:28:05 -0000 > yep I'd have to agree with that.. > All the needed bits should already be there. > > > > start with natd and chop it until you have what you want.. > > > > > ports/net/tcpmssd might be easier to adopt. ---end quoted text--- Yes maybe it is good way to do this but what if i do not use ipfw. I am using pf and i do not have IPDIVERT in kernel. Is some kind of packet forward to this daemon will work ? -- Best Regards: GiZmen UNIX is user-friendly; it's just picky about its friends UNIX is simple; it just takes a genius to understand its simplicity From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 10:17:40 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8DE7F16A4CE for ; Fri, 23 Apr 2004 10:17:40 -0700 (PDT) Received: from office.suresupport.com (office.suresupport.com [213.145.98.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 4F18043D2D for ; Fri, 23 Apr 2004 10:17:39 -0700 (PDT) (envelope-from nike_d@cytexbg.com) Received: (qmail 76153 invoked by uid 1026); 23 Apr 2004 17:14:10 -0000 Received: from nike_d@cytexbg.com by office.suresupport.com by uid 1004 with qmail-scanner-1.20 (f-prot: 4.3.1/3.14.7. Clear:RC:1(213.145.98.38):. Processed in 0.116011 secs); 23 Apr 2004 17:14:10 -0000 Received: from unknown (HELO phobos.totalterror.net) (213.145.98.38) by office.suresupport.com with SMTP; 23 Apr 2004 17:14:10 -0000 References: <20040423053702.GD64148@ip.net.ua> <20040423113203.GB41414@blurp.one.pl> Message-ID: X-Mailer: http://www.courier-mta.org/cone/ From: Niki Denev To: GiZmen Date: Fri, 23 Apr 2004 20:17:41 +0300 Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=_mimegpg-phobos.totalterror.net-72033-1082740661-0003"; micalg=pgp-sha1; protocol="application/pgp-signature" cc: freebsd-hackers@freebsd.org Subject: Re: Changing ttl of incoming packets X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 17:17:40 -0000 This is a MIME GnuPG-signed message. If you see this text, it means that your E-mail or Usenet software does not support MIME signed messages. --=_mimegpg-phobos.totalterror.net-72033-1082740661-0003 Content-Type: text/plain; format=flowed; charset="US-ASCII" Content-Disposition: inline Content-Transfer-Encoding: 7bit GiZmen writes: >> yep I'd have to agree with that.. >> All the needed bits should already be there. >> >> > > start with natd and chop it until you have what you want.. >> > > >> > ports/net/tcpmssd might be easier to adopt. > ---end quoted text--- > > Yes maybe it is good way to do this but what if i do not use ipfw. > I am using pf and i do not have IPDIVERT in kernel. Is some kind of packet > forward to this daemon will work ? > > -- > Best Regards: > GiZmen > > UNIX is user-friendly; it's just picky about its friends > UNIX is simple; it just takes a genius to understand its simplicity > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > in pf you can 'log' the packets that you want to modify, and sniff them on pflog0, or maybe even redirect them to localhost(this seems to be closer to the IPDIVERT behaviour) --niki --=_mimegpg-phobos.totalterror.net-72033-1082740661-0003 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQBAiU+1HNAJ/fLbfrkRAoE8AKDG8kIrhzIFL351AtPgLC1ATRYhUgCfYalh VfZJe7n698t9us1/nayHm6c= =zC3c -----END PGP SIGNATURE----- --=_mimegpg-phobos.totalterror.net-72033-1082740661-0003-- From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 14:18:11 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E650C16A4D0 for ; Fri, 23 Apr 2004 14:18:11 -0700 (PDT) Received: from mailserv1.neuroflux.com (mailserv1.neuroflux.com [204.228.228.92]) by mx1.FreeBSD.org (Postfix) with ESMTP id 90D8343D5C for ; Fri, 23 Apr 2004 14:18:11 -0700 (PDT) (envelope-from ryans@gamersimpact.com) Received: (qmail 57017 invoked by uid 89); 23 Apr 2004 21:18:59 -0000 Received: from unknown (HELO www2.neuroflux.com) (127.0.0.1) by localhost with SMTP; 23 Apr 2004 21:18:59 -0000 Received: from 63.226.178.14 (SquirrelMail authenticated user ryans@gamersimpact.com) by www2.neuroflux.com with HTTP; Fri, 23 Apr 2004 15:18:59 -0600 (MDT) Message-ID: <49216.63.226.178.14.1082755139.squirrel@www2.neuroflux.com> Date: Fri, 23 Apr 2004 15:18:59 -0600 (MDT) From: "Ryan Sommers" To: hackers@freebsd.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal Subject: Method of compiling boot0 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 21:18:12 -0000 I was browsing over the boot0 makefiles and source when I was playing with some boot sector code of mine and I was wondering why the designers chose to use objcopy to output a binary file instead of just using the --oformat option when it's run over the linker. I'm guessing it's just 6 of one and half dozen of the other but was just curious incase there was actually some difference. Ryan -- Ryan "leadZERO" Sommers Gamer's Impact President ryans@gamersimpact.com ICQ: 1019590 AIM/MSN: leadZERO -= http://www.gamersimpact.com =- From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 15:19:28 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F46716A4CE for ; Fri, 23 Apr 2004 15:19:28 -0700 (PDT) Received: from mxsf05.cluster1.charter.net (mxsf05.cluster1.charter.net [209.225.28.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E5AB43D41 for ; Fri, 23 Apr 2004 15:19:27 -0700 (PDT) (envelope-from ups@tree.com) Received: from stups.com ([209.187.143.11])i3NMAkjH063957; Fri, 23 Apr 2004 18:10:56 -0400 (EDT) Received: from tree.com (localhost [127.0.0.1]) by stups.com (8.9.3/8.9.3) with ESMTP id SAA06432; Fri, 23 Apr 2004 18:10:44 -0400 Message-Id: <200404232210.SAA06432@stups.com> X-Mailer: exmh version 2.0.2 To: Matthew Dillon In-Reply-To: Message from Matthew Dillon <200404230326.i3N3QBAp004589@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 23 Apr 2004 18:10:44 -0400 From: Stephan Uphoff cc: hackers@freebsd.org cc: Julian Elischer cc: Stephan Uphoff Subject: Re: Re99: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 22:19:28 -0000 Matthew Dillon wrote: > The idea with the fix is as follows: > > * It's hard to make the VM system invalidate buffers, so don't try. > But it is easy to throw away clean buffers since they are nicely sorted and easy to release. Efficient locking is a bit tricky but should not be to bad. > > Instead, make UFS recognize the IO_INVAL ioflag and mark the buffer > appropriately in the putpages -> generic put pages -> VOP_WRITE() path. This is a nice optimization - so we don't have to delete the buffer once it is clean. > > This only occurs if the msync'd map was writable. If the msync'd map was > only readable, then the data is not flushed through the vnode system and > the pages will not be removed if there happens to be a buffer associated > with them, even if the buffer is clean. I would advise to also flush read only mapped data. (like 5.x) On writeable maps clean pages will also not be removed if a buffer is associated with them. ( For example the sequence msync(a,l,MS_SYNC); msync(a,l,MS_INVALIDATE|MS_SYNC ) will not invalidate/destroy the buffers) > > I think this is reasonable. Not perfect, but reasonable. > > * Set clean_only to TRUE when calling vm_object_page_remove(), which > causes vm_object_page_remove() to ignore wired or dirty pages. This > code is called for both readable and writable maps so we can't just > remove the page unconditionallty, hence clean_only should be > set to TRUE. Yes - see earlier email. > > This means that any pages associated with the buffer cache will NOT > be removed if the map was read-only. If the map was writable, then > the IO_INVAL fix above will destroy the buffer and the page should > wind up not being wired any more, and thus will be properly removed. > > That's it! > > -Matt The patch solves the data loss problem. This is the really critical part. When I get the time (probably not next week) I will write a patch to release the cached buffers that would prevent page removal. Stephan From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 15:22:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F1B616A4CE for ; Fri, 23 Apr 2004 15:22:10 -0700 (PDT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBB2443D2D for ; Fri, 23 Apr 2004 15:22:09 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc11) with ESMTP id <2004042322220801100p85jae>; Fri, 23 Apr 2004 22:22:08 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id PAA10352; Fri, 23 Apr 2004 15:22:07 -0700 (PDT) Date: Fri, 23 Apr 2004 15:22:07 -0700 (PDT) From: Julian Elischer To: Stephan Uphoff In-Reply-To: <200404232210.SAA06432@stups.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: hackers@freebsd.org Subject: Re: Re99: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 22:22:10 -0000 with this bug could a user zero out /etc/group or similar? I am not sure what the ramification of the bug is.. On Fri, 23 Apr 2004, Stephan Uphoff wrote: > > Matthew Dillon wrote: > > > The idea with the fix is as follows: > > > > * It's hard to make the VM system invalidate buffers, so don't try. > > > > But it is easy to throw away clean buffers since they are nicely sorted > and easy to release. > Efficient locking is a bit tricky but should not be to bad. > > > > > Instead, make UFS recognize the IO_INVAL ioflag and mark the buffer > > appropriately in the putpages -> generic put pages -> VOP_WRITE() path. > > This is a nice optimization - so we don't have to delete the buffer > once it is clean. > > > > > This only occurs if the msync'd map was writable. If the msync'd map was > > only readable, then the data is not flushed through the vnode system and > > the pages will not be removed if there happens to be a buffer associated > > with them, even if the buffer is clean. > > I would advise to also flush read only mapped data. (like 5.x) > On writeable maps clean pages will also not be removed if a buffer is > associated with them. > ( For example the sequence msync(a,l,MS_SYNC); msync(a,l,MS_INVALIDATE|MS_SYNC > ) > will not invalidate/destroy the buffers) > > > > > I think this is reasonable. Not perfect, but reasonable. > > > > * Set clean_only to TRUE when calling vm_object_page_remove(), which > > causes vm_object_page_remove() to ignore wired or dirty pages. This > > code is called for both readable and writable maps so we can't just > > remove the page unconditionallty, hence clean_only should be > > set to TRUE. > > Yes - see earlier email. > > > > > This means that any pages associated with the buffer cache will NOT > > be removed if the map was read-only. If the map was writable, then > > the IO_INVAL fix above will destroy the buffer and the page should > > wind up not being wired any more, and thus will be properly removed. > > > > That's it! > > > > -Matt > > The patch solves the data loss problem. > This is the really critical part. > > When I get the time (probably not next week) I will write a patch > to release the cached buffers that would prevent page removal. > > > Stephan > > From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 16:55:46 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BC8C16A4CF for ; Fri, 23 Apr 2004 16:55:46 -0700 (PDT) Received: from mxsf16.cluster1.charter.net (mxsf16.cluster1.charter.net [209.225.28.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id C9A4C43D39 for ; Fri, 23 Apr 2004 16:55:45 -0700 (PDT) (envelope-from ups@tree.com) Received: from stups.com ([209.187.143.11])i3NNjb4s050466; Fri, 23 Apr 2004 19:45:38 -0400 (EDT) Received: from tree.com (localhost [127.0.0.1]) by stups.com (8.9.3/8.9.3) with ESMTP id TAA10405; Fri, 23 Apr 2004 19:45:37 -0400 Message-Id: <200404232345.TAA10405@stups.com> X-Mailer: exmh version 2.0.2 To: Julian Elischer In-Reply-To: Message from Julian Elischer Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 23 Apr 2004 19:45:37 -0400 From: Stephan Uphoff cc: hackers@freebsd.org cc: Stephan Uphoff Subject: Re: Re99: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 23:55:46 -0000 Julian Elischer wrote: > with this bug could a user zero out /etc/group or similar? > I am not sure what the ramification of the bug is.. The bug affects only in memory modified file data. In memory modifications to the file can be deleted and the file data reverts to a state before the file modification. (Not unlike a crash/power failure ) The worst security scenario I can think of is the possibility to revert a file to uninitialized disk data blocks or to prevent the update of a file. Stephan From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 18:37:06 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD13116A4CE for ; Fri, 23 Apr 2004 18:37:06 -0700 (PDT) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC85743D54 for ; Fri, 23 Apr 2004 18:37:06 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) i3O1b47Z010071; Fri, 23 Apr 2004 18:37:04 -0700 (PDT) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.12.9p2/8.12.9/Submit) id i3O1b4W0010070; Fri, 23 Apr 2004 18:37:04 -0700 (PDT) (envelope-from dillon) Date: Fri, 23 Apr 2004 18:37:04 -0700 (PDT) From: Matthew Dillon Message-Id: <200404240137.i3O1b4W0010070@apollo.backplane.com> To: Stephan Uphoff References: <200404232345.TAA10405@stups.com> cc: hackers@freebsd.org cc: Julian Elischer cc: Stephan Uphoff Subject: Re: Re99: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 01:37:06 -0000 :When I get the time (probably not next week) I will write a patch :to release the cached buffers that would prevent page removal. I would appreciate a CC if/when you have something along these lines. It won't be easy. The VM system has no reliable way to determine the buffer cache block size for a VM object or VNODE, nor any idea how to deal with the buffer state which can vary in subtle ways between VFS's (e.g. NFS vs UFS). So a new VOP call would probably have to be created to clean out the buffers associated with a memory range. We might want to create such a call anyway in order to support ranged fsync()'s. :The bug affects only in memory modified file data. : :In memory modifications to the file can be deleted :and the file data reverts to a state before the :file modification. (Not unlike a crash/power failure ) : :The worst security scenario I can think of is the possibility :to revert a file to uninitialized disk data blocks or to :prevent the update of a file. : : Stephan I won't say that it's imposible, but it would sure be hard to accomplish since access to uninitialized disk data blocks is going to be governed by the buffer cache, and the buffer is cleared unconditionally when balloc'd inside ffs_write() (and the blocks will not be assigned if one tries to do a read() if a file hole). The only other code that calls VOP_BALLOC() for a file block is ftruncate(), and it also does an unconditional write. -Matt Matthew Dillon From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 10:35:14 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 557E516A4D0; Fri, 23 Apr 2004 10:35:14 -0700 (PDT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85C8043D31; Fri, 23 Apr 2004 10:35:13 -0700 (PDT) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i3NHdvLh099042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Apr 2004 20:39:59 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.12.11/8.12.11) id i3NHZIJo003269; Fri, 23 Apr 2004 20:35:18 +0300 (EEST) (envelope-from ru) Date: Fri, 23 Apr 2004 20:35:18 +0300 From: Ruslan Ermilov To: David Yeske Message-ID: <20040423173518.GC2922@ip.net.ua> References: <20040423005057.15006.qmail@web13504.mail.yahoo.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Content-Disposition: inline In-Reply-To: <20040423005057.15006.qmail@web13504.mail.yahoo.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) X-Mailman-Approved-At: Sat, 24 Apr 2004 04:56:28 -0700 cc: Archie Cobbs cc: net@FreeBSD.org Subject: Re: netgraph ability X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2004 17:35:14 -0000 --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [ Redirected to -net ] On Thu, Apr 22, 2004 at 05:50:57PM -0700, David Yeske wrote: > I'm in a situation where I need to emulate multiple ethernet devices with > different mac addresses. I have gotten far enough to have this. >=20 > I ran ngctl and then ran > "mkpeer . eiface hook ether" >=20 > I then ran > ifconfig ngeth0 link '00:bd:03:11:21:11' > ifconfig ngeth0 192.168.20.5 > ifconfig sis0 192.168.23.45 >=20 > So basically I want to be able to ping / connect to=20 > 192.168.20.5 from another box on the 192.168.23.0/24 network, and have it= see > the mac address that I have set rather than the mac address of my sis0 de= vice. > I know I can do this with vmware, but I am trying to avoid that. >=20 > Anyone know if this is possible? Is there a way to do this with the tap = device > and or arpd? >=20 Using Netgraph, you can emulate any number of Ethernet interfaces on one physical interface. Here's my recipe for you: 1. Load the ng_ether(4) module. 2. Create the required number of ng_eiface(4) nodes. 3. Connect "lower" and "upper" of sis0: and all ngethX: ng_ether(4) nodes to one ng_bridge(4). 4. Make sure to "ngctl msg : setautosrc 0" to all ng_ether(4) nodes. 5. Optionally set net.link.ether.inet.log_arp_wrong_iface=3D0. Here's my test (I've omitted obvious configuration steps): # ifconfig dc0 ether dc0: flags=3D8843 mtu 1500 options=3D48 ether 00:10:a4:c0:c0:45 # ifconfig ngeth0 ngeth0: flags=3D8843 mtu 1500 ether 00:00:00:01:02:03 # ngctl show bridge: Name: bridge Type: bridge ID: 0000000b Num hooks: 4 Local hook Peer name Peer type Peer ID Peer hook ---------- --------- --------- ------- --------- link4 ngeth0 ether 00000007 lower link3 ngeth0 ether 00000007 upper link2 dc0 ether 00000002 lower link1 dc0 ether 00000002 upper # ifconfig ngeth0 1.2.3.4 # tcpdump -lenx -i dc0 ether host 0:0:0:1:2:3 tcpdump: listening on dc0 20:29:05.571179 0:0:0:1:2:3 ff:ff:ff:ff:ff:ff 0806 42: arp who-has 1.2.3.4 = tell 1.2.3.4 0001 0800 0604 0001 0000 0001 0203 0102 0304 0000 0000 0000 0102 0304 Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAiVPWUkv4P6juNwoRAm9cAJ408iFmsjqyt7BsbUCLLdBghhM7YACfcYJv qqwP5OCSr4gezalcnT0WFIg= =fYNN -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM-- From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 23 22:39:27 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6C98E16A4CE for ; Fri, 23 Apr 2004 22:39:27 -0700 (PDT) Received: from mail.transactionware.com (mail.transactionware.com [203.14.245.7]) by mx1.FreeBSD.org (Postfix) with SMTP id DFB6A43D45 for ; Fri, 23 Apr 2004 22:39:25 -0700 (PDT) (envelope-from janm@transactionware.com) Received: (qmail 5965 invoked from network); 24 Apr 2004 05:39:45 -0000 Received: from new.transactionware.com (192.168.1.55) by dm.transactionware.com with SMTP; 24 Apr 2004 05:39:45 -0000 Received: (qmail 82963 invoked by uid 1006); 24 Apr 2004 05:39:44 -0000 Received: from janm@transactionware.com by new.transactionware.com Clear:0. Processed in 0.505664 secs); 24 Apr 2004 05:39:44 -0000 Received: from unknown (HELO JMLAPTOP) (192.168.4.2) by new.transactionware.com with SMTP; 24 Apr 2004 05:39:43 -0000 From: "Jan Mikkelsen" To: "'Julian Elischer'" , Date: Sat, 24 Apr 2004 15:40:30 +1000 Organization: Transactionware Message-ID: <000f01c429be$a7e9f7f0$0204a8c0@transactionware.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.4510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 In-Reply-To: Importance: Normal X-Mailman-Approved-At: Sat, 24 Apr 2004 04:56:28 -0700 Subject: RE: how to flush out cache.? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 05:39:27 -0000 Julian Elischer wrote: > Other than reading a few GB of data, is there a way to flush > out the cache copy of a file I've written? I don't know how this will fit into your application, but unmounting and remounting the filesystem is a way that springs to mind. Perhaps not as isloated as you'd like, but still ... Regards, Jan Mikkelsen janm@transactionware.com From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 08:18:39 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F8C716A4CE; Sat, 24 Apr 2004 08:18:39 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E75E43D31; Sat, 24 Apr 2004 08:18:39 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 10D9C5C802; Sat, 24 Apr 2004 08:18:39 -0700 (PDT) Date: Sat, 24 Apr 2004 08:18:39 -0700 From: Alfred Perlstein To: Alexey Dokuchaev Message-ID: <20040424151839.GB78817@elvis.mu.org> References: <200404231627.i3NGRcVA096244@repoman.freebsd.org> <20040424085913.GA78817@elvis.mu.org> <20040424101446.GA12719@regency.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040424101446.GA12719@regency.nsu.ru> User-Agent: Mutt/1.4.2.1i cc: hackers@freebsd.org cc: Tim Kientzle cc: Julian Elischer Subject: Re: bad news for bsdtar.. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 15:18:39 -0000 * Alexey Dokuchaev [040424 03:14] wrote: > On Sat, Apr 24, 2004 at 01:59:13AM -0700, Alfred Perlstein wrote: > > > > Have you guys thought of using aio or at least another process > > to parallelize IO? (One to read files, and one to write out the > > archive) > > > > Actually with our kernel threads in 5 you could just use those > > to speed IO. > > IMHO, still non-blocking/async IO would be faster, and more probably portable, > unless I'm utterly wrong, of course. 8-) Threads are pretty portable these days, obviously making it a compile time option could work, but then again performance would be nice and it is _our_ tar. ;) Also, unless you mean 'aio' or 'another process' by "non-blocking/async IO" then I'm pretty sure you are wrong, as there is no other way to do this, disk based files do not really support SIGIO (async IO) or non-blocking IO (NBIO). -- - Alfred Perlstein - Research Engineering Development Inc. - email: bright@mu.org cell: 408-480-4684 From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 08:59:48 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16A6C16A4CE; Sat, 24 Apr 2004 08:59:48 -0700 (PDT) Received: from saturn.criticalmagic.com (saturn.criticalmagic.com [68.213.16.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76CDE43D5F; Sat, 24 Apr 2004 08:59:47 -0700 (PDT) (envelope-from richardcoleman@mindspring.com) Received: from mindspring.com (titan.criticalmagic.com [68.213.16.23]) by saturn.criticalmagic.com (Postfix) with ESMTP id 45B143BD2A; Sat, 24 Apr 2004 11:59:44 -0400 (EDT) Message-ID: <408A8EFD.4030708@mindspring.com> Date: Sat, 24 Apr 2004 11:59:57 -0400 From: Richard Coleman Organization: Critical Magic, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <200404231627.i3NGRcVA096244@repoman.freebsd.org> <20040424085913.GA78817@elvis.mu.org> <20040424101446.GA12719@regency.nsu.ru> <20040424151839.GB78817@elvis.mu.org> In-Reply-To: <20040424151839.GB78817@elvis.mu.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Tim Kientzle Subject: Re: bad news for bsdtar.. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: richardcoleman@mindspring.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 15:59:48 -0000 Alfred Perlstein wrote: > Threads are pretty portable these days, obviously making it a compile > time option could work, but then again performance would be nice and > it is _our_ tar. ;) > > Also, unless you mean 'aio' or 'another process' by > "non-blocking/async IO" then I'm pretty sure you are wrong, as there > is no other way to do this, disk based files do not really support > SIGIO (async IO) or non-blocking IO (NBIO). I think it is much more important that libarchive be clean, reliabable, and maintainable than squeeze out the last bit of performance. That better serves the goal of libarchive being embedded in everything (tar, pax, cpio, pkg_*, etc). Tim has done a great job with this so far. Richard Coleman richardcoleman@mindspring.com From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 09:03:49 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B52716A4CF for ; Sat, 24 Apr 2004 09:03:49 -0700 (PDT) Received: from mizar.origin-it.net (mizar.origin-it.net [194.8.96.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79C9E43D48 for ; Sat, 24 Apr 2004 09:03:48 -0700 (PDT) (envelope-from Helge.Oldach@atosorigin.com) Received: from matar.hbg.de.int.atosorigin.com (dehsfw3e.origin-it.net [194.8.96.68])i3OG3ktJ082627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Apr 2004 18:03:47 +0200 (CEST) (envelope-from Helge.Oldach@atosorigin.com) Received: from dehhx004.hbg.de.int.atosorigin.com (dehhx004.hbg.de.int.atosorigin.com [161.90.164.40]) ESMTP id i3OG3kIJ082536; Sat, 24 Apr 2004 18:03:46 +0200 (CEST) (envelope-from Helge.Oldach@atosorigin.com) Received: by dehhx004.hbg.de.int.atosorigin.com with Internet Mail Service (5.5.2657.72) id ; Sat, 24 Apr 2004 18:03:46 +0200 Message-ID: From: "Oldach, Helge" To: freebsd-hackers@freebsd.org Date: Sat, 24 Apr 2004 18:03:39 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="windows-1252" cc: 'Mike Tancsa' Subject: RE: FAST_IPSEC bug fix X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 16:03:49 -0000 Hi list, this is a month-old mail about the lack of a FAST_IPSEC feature compared to legacy IPSEC. Including a working patch. I haven't seen this being committed, or is it? Please also MFC to STABLE. Regards, Helge > -----Original Message----- > From: owner-freebsd-hackers@freebsd.org > [mailto:owner-freebsd-hackers@freebsd.org]On Behalf Of Mike Tancsa > Sent: Tuesday, 30. March 2004 19:14 > To: freebsd-hackers@freebsd.org > Subject: FAST_IPSEC bug fix > > > > Well, its not totally a bug, but missing functionality that > looks like is > there but is not and is pretty important to keep lossy links > functioning > with IPSEC. My colleague gabor@sentex.net created the patch > below that > implements net.key.prefered_oldsa when using FAST_IPSEC. The > discussion > has come up before about this, but no action. I know > sam@freebsd.org is > really busy and cannot help. Is there anyone out there who > could review and > commit the patch below ? It works against RELENG_4 > > I have bcc'd the last 2 committers to touch the code in the > hopes that they > might have the time and inclination to review / commit ? > > > *** /usr/src/sys/netipsec/key.c Mon Mar 29 20:11:44 2004 > --- ./key.c Tue Mar 30 12:00:31 2004 > *************** > *** 133,138 **** > --- 133,139 ---- > #endif > static LIST_HEAD(_spacqtree, secspacq) spacqtree; /* > SP acquiring > list */ > > + #if 0 > /* search order for SAs */ > static u_int saorder_state_valid[] = { > SADB_SASTATE_DYING, SADB_SASTATE_MATURE, > *************** > *** 141,146 **** > --- 142,154 ---- > * for outbound processing. For inbound, This is > not important. > */ > }; > + #endif > + static const u_int saorder_state_valid_prefer_old[] = { > + SADB_SASTATE_DYING, SADB_SASTATE_MATURE, > + }; > + static const u_int saorder_state_valid_prefer_new[] = { > + SADB_SASTATE_MATURE, SADB_SASTATE_DYING, > + }; > static u_int saorder_state_alive[] = { > /* except DEAD */ > SADB_SASTATE_MATURE, SADB_SASTATE_DYING, SADB_SASTATE_LARVAL > *************** > *** 816,821 **** > --- 824,831 ---- > struct secashead *sah; > struct secasvar *sav; > u_int stateidx, state; > + const u_int *saorder_state_valid; > + int arraysize; > > LIST_FOREACH(sah, &sahtree, chain) { > if (sah->state == SADB_SASTATE_DEAD) > *************** > *** 828,836 **** > > found: > > /* search valid state */ > for (stateidx = 0; > ! stateidx < _ARRAYLEN(saorder_state_valid); > stateidx++) { > > state = saorder_state_valid[stateidx]; > --- 838,853 ---- > > found: > > + if (key_prefered_oldsa) { > + saorder_state_valid = saorder_state_valid_prefer_old; > + arraysize = _ARRAYLEN(saorder_state_valid_prefer_old); > + } else { > + saorder_state_valid = saorder_state_valid_prefer_new; > + arraysize = _ARRAYLEN(saorder_state_valid_prefer_new); > + } > /* search valid state */ > for (stateidx = 0; > ! stateidx < arraysize; > stateidx++) { > > state = saorder_state_valid[stateidx]; > *************** > *** 997,1008 **** > --- 1014,1034 ---- > struct secasvar *sav; > u_int stateidx, state; > int s; > + const u_int *saorder_state_valid; > + int arraysize; > > KASSERT(dst != NULL, ("key_allocsa: null dst address")); > > KEYDEBUG(KEYDEBUG_IPSEC_STAMP, > printf("DP key_allocsa from %s:%u\n", where, tag)); > > + if (key_prefered_oldsa) { > + saorder_state_valid = saorder_state_valid_prefer_old; > + arraysize = _ARRAYLEN(saorder_state_valid_prefer_old); > + } else { > + saorder_state_valid = saorder_state_valid_prefer_new; > + arraysize = _ARRAYLEN(saorder_state_valid_prefer_new); > + } > /* > * searching SAD. > * XXX: to be checked internal IP header somewhere. > Also when > *************** > *** 1013,1019 **** > LIST_FOREACH(sah, &sahtree, chain) { > /* search valid state */ > for (stateidx = 0; > ! stateidx < _ARRAYLEN(saorder_state_valid); > stateidx++) { > state = saorder_state_valid[stateidx]; > LIST_FOREACH(sav, > &sah->savtree[state], chain) { > --- 1039,1045 ---- > LIST_FOREACH(sah, &sahtree, chain) { > /* search valid state */ > for (stateidx = 0; > ! stateidx < arraysize; > stateidx++) { > state = saorder_state_valid[stateidx]; > LIST_FOREACH(sav, > &sah->savtree[state], chain) { > -------------------------------------------------------------------- > Mike Tancsa, tel > +1 519 651 3400 > Sentex Communications, mike@sentex.net > Providing Internet since 1994 www.sentex.net > Cambridge, Ontario Canada www.sentex.net/mike > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 10:11:26 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0742416A4CE for ; Sat, 24 Apr 2004 10:11:26 -0700 (PDT) Received: from blurp.one.pl (blurp.t4.ds.pwr.wroc.pl [156.17.226.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9207B43D31 for ; Sat, 24 Apr 2004 10:11:25 -0700 (PDT) (envelope-from gizmen@blurp.one.pl) Received: by blurp.one.pl (Postfix, from userid 1001) id 6010A9C2; Sat, 24 Apr 2004 17:00:52 +0200 (CEST) Date: Sat, 24 Apr 2004 17:00:50 +0200 From: GiZmen To: freebsd-hackers@freebsd.org Message-ID: <20040424150050.GA93683@blurp.one.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: device pooling and high interrupts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 17:11:26 -0000 Hello, I am runnign freebsd 5.2.1 on 386 arch with two rl lan cards. My mainboard is on VIA KT 266A with AMD athlon 1.1. I read man polling and i have HZ=1000. My problem is that when i set up sysctl variable kern.polling.enable=1 my interrupts greatly increase. When my system is idle and indicate 0-1% interrupts with out polling. and when i turn on polling interrupts goes up to about 20% on idle system. Is it normal ? I never before use polling and i dont know that i have something bad in my system ? Can somebody explain me this ? thx -- Best Regards: GiZmen UNIX is user-friendly; it's just picky about its friends UNIX is simple; it just takes a genius to understand its simplicity From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 11:03:15 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2612D16A4CE for ; Sat, 24 Apr 2004 11:03:15 -0700 (PDT) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42F7F43D5A for ; Sat, 24 Apr 2004 11:03:14 -0700 (PDT) (envelope-from marck@rinet.ru) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.12.11/8.12.11) with ESMTP id i3OI3Auk028965; Sat, 24 Apr 2004 22:03:10 +0400 (MSD) (envelope-from marck@rinet.ru) Date: Sat, 24 Apr 2004 22:03:10 +0400 (MSD) From: Dmitry Morozovsky To: GiZmen In-Reply-To: <20040424150050.GA93683@blurp.one.pl> Message-ID: <20040424220116.A22548@woozle.rinet.ru> References: <20040424150050.GA93683@blurp.one.pl> X-NCC-RegID: ru.rinet MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: device pooling and high interrupts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 18:03:15 -0000 On Sat, 24 Apr 2004, GiZmen wrote: G> I am runnign freebsd 5.2.1 on 386 arch with two rl lan cards. My mainboard G> is on VIA KT 266A with AMD athlon 1.1. G> I read man polling and i have HZ=1000. My problem is that when i set up G> sysctl variable kern.polling.enable=1 my interrupts greatly increase. G> When my system is idle and indicate 0-1% interrupts with out polling. G> and when i turn on polling interrupts goes up to about 20% on idle system. G> Is it normal ? I never before use polling and i dont know that i have G> something bad in my system ? G> G> Can somebody explain me this ? It seems pretty normal under such low load. polling is worth turning on when you have interrupt load spikes more than, say, 40-50% (e.g. highly saturated 100Mbps router with more than two interfaces and/or VLANs) Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 11:14:10 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E6E6016A4CE for ; Sat, 24 Apr 2004 11:14:10 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 66C7F43D49 for ; Sat, 24 Apr 2004 11:14:10 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 87583 invoked from network); 24 Apr 2004 18:14:09 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 24 Apr 2004 18:14:09 -0000 X-pair-Authenticated: 209.68.2.70 Date: Sat, 24 Apr 2004 13:14:26 -0500 (CDT) From: Mike Silbersack To: GiZmen In-Reply-To: <20040424150050.GA93683@blurp.one.pl> Message-ID: <20040424131214.B5713@odysseus.silby.com> References: <20040424150050.GA93683@blurp.one.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: device pooling and high interrupts X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 18:14:11 -0000 On Sat, 24 Apr 2004, GiZmen wrote: > Hello, > > I am runnign freebsd 5.2.1 on 386 arch with two rl lan cards. My mainboard > is on VIA KT 266A with AMD athlon 1.1. > I read man polling and i have HZ=1000. My problem is that when i set up > sysctl variable kern.polling.enable=1 my interrupts greatly increase. > When my system is idle and indicate 0-1% interrupts with out polling. > and when i turn on polling interrupts goes up to about 20% on idle system. > Is it normal ? I never before use polling and i dont know that i have > something bad in my system ? > > Can somebody explain me this ? > > thx > -- > Best Regards: > GiZmen Ruslan can probably jump in and give you a better explanation than I can, but I'll try to provide a quick answer. In short, the rl cards + driver are not well suited to polling and will not work well with it enabled. Support for polling on rl may in fact be removed as a result of this. Mike "Silby" Silbersack From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 11:23:30 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 31FB516A4CE for ; Sat, 24 Apr 2004 11:23:30 -0700 (PDT) Received: from smtp3b.sentex.ca (smtp3b.sentex.ca [205.211.164.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id E013143D1D for ; Sat, 24 Apr 2004 11:23:29 -0700 (PDT) (envelope-from mike@sentex.net) Received: from avscan2.sentex.ca (avscan2.sentex.ca [199.212.134.19]) by smtp3b.sentex.ca (8.12.11/8.12.11) with ESMTP id i3OINQvp024564; Sat, 24 Apr 2004 14:23:26 -0400 (EDT) (envelope-from mike@sentex.net) Received: from localhost (localhost [127.0.0.1]) by avscan2.sentex.ca (Postfix) with ESMTP id 20E0459C8B; Sat, 24 Apr 2004 14:23:26 -0400 (EDT) Received: from avscan2.sentex.ca ([127.0.0.1]) by localhost (avscan2.sentex.ca [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 71225-01; Sat, 24 Apr 2004 14:23:26 -0400 (EDT) Received: from lava.sentex.ca (pyroxene.sentex.ca [199.212.134.18]) by avscan2.sentex.ca (Postfix) with ESMTP id 05B4759C89; Sat, 24 Apr 2004 14:23:26 -0400 (EDT) Received: from simian.sentex.net (simeon.sentex.ca [192.168.43.27]) by lava.sentex.ca (8.12.11/8.12.11) with ESMTP id i3OINOJN056387; Sat, 24 Apr 2004 14:23:25 -0400 (EDT) (envelope-from mike@sentex.net) Message-Id: <6.0.3.0.0.20040424142123.07bf3db0@64.7.153.2> X-Sender: mdtpop@64.7.153.2 (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.0.3.0 Date: Sat, 24 Apr 2004 14:24:52 -0400 To: Sam Leffler , "Oldach, Helge" From: Mike Tancsa In-Reply-To: <44658B20-9610-11D8-AAEB-000A95AD0668@errno.com> References: <44658B20-9610-11D8-AAEB-000A95AD0668@errno.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new X-Virus-Scanned: by amavisd-new at (avscan2) sentex.ca cc: freebsd-hackers@freebsd.org Subject: Re: FAST_IPSEC bug fix X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 18:23:30 -0000 At 12:56 PM 24/04/2004, Sam Leffler wrote: >On Apr 24, 2004, at 9:03 AM, Oldach, Helge wrote: > >>Hi list, >> >>this is a month-old mail about the lack of a FAST_IPSEC feature compared >>to legacy IPSEC. Including a working patch. I haven't seen this being >>committed, or is it? Please also MFC to STABLE. > >The fix was not quite right for -current (where it needs to go in >first). I sent out the attached patch for testing but received no >feedback. Until I can get it tested and committed to -current it won't be >MFC'd. We dont run -current here, so I dont have anything to test it on. Also, due to the bugs in the driver with HiFn 7955, we have had to abandon FAST_IPSEC :( ---Mike From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 11:27:33 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F18216A4CE for ; Sat, 24 Apr 2004 11:27:33 -0700 (PDT) Received: from mail.1plan.net (ns1.1plan.net [216.240.143.74]) by mx1.FreeBSD.org (Postfix) with SMTP id 0D50A43D58 for ; Sat, 24 Apr 2004 11:27:31 -0700 (PDT) (envelope-from aanton@reversedhell.net) Received: (qmail 37353 invoked by uid 98); 24 Apr 2004 18:33:31 -0000 Received: from aanton@reversedhell.net by cp by uid 101 with qmail-scanner-1.20 (clamscan: 0.65. Clear:RC:1(81.196.32.25):SA:0(-99.5/5.0):. Processed in 1.955386 secs); 24 Apr 2004 18:33:31 -0000 X-Spam-Status: No, hits=-99.5 required=5.0 X-Qmail-Scanner-Mail-From: aanton@reversedhell.net via cp X-Qmail-Scanner: 1.20 (Clear:RC:1(81.196.32.25):SA:0(-99.5/5.0):. Processed in 1.955386 secs) Received: from unknown (HELO reversedhell.net) (81.196.32.25) by ns1.1plan.net with SMTP; 24 Apr 2004 18:33:29 -0000 Message-ID: <408AB18B.9020906@reversedhell.net> Date: Sat, 24 Apr 2004 21:27:23 +0300 From: Anton Alin-Adrian User-Agent: Mozilla Thunderbird 0.5 (X11/20040303) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org X-Enigmail-Version: 0.83.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------060702070401020708010807" Subject: FreeBSD's malloc problem ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 18:27:33 -0000 This is a multi-part message in MIME format. --------------060702070401020708010807 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hello hackers ! Before anything else, I must mention I am running FreeBSD 4.9-RELEASE, and that is the OS where I encounter the problem. I was developing some functions fooling around for parsing some bigger opensource project's config file and look what happened: There are many functions inside, only adjust_spaces(char *s) is the interesting one! The problem does *not* exist on Linux systems. Now, before getting into anything fancy, I want to mention that I am horribly ill and this posting may be terribly lame and the only one who has faults may be me with my code. BUT, if that is not the case, then this might be a bug in FreeBSD malloc's mechanism. Ok here it goes. The problem is at line 68 in the attached file, in function adjust_spaces(char *s): ---code snippet--- char *adjust_spaces(char *s) { char *tmp; int i=0,j=0,count=0; int is_leading=0,last_space=0; tmp = (char *) malloc(strlen(s)); // line 68 ........ ........ } ---code snippet--- If the function is called exactly as in the code, with the buffer setup to: ---code snippet--- int main (void) { char buf[]="allowed_ip abcde#"; // like that, other combination // have the same result char *s; if (is_definition(buf)) fprintf(stderr,"DEFINITION found\n"); else fprintf(stderr,"Nothing found\n"); split_line(buf); } ---code snippet--- then at line 90 and possibly 79 too: tmp[j]=s[i]; // line 90 the first character of the string pointed to by *tmp (which was malloced before, at line 68) will *overwrite* the null terminating '\0' character of the string pointed to by *s (and given as input to the function). This later results in an infinite counter loop and an integer overflow, but the integer overflow will not become reality because the program will try to read/write from invalid memory locations and will crash receiving a segmentation fault. ALL THIS never happens, if at line 68 I use this code: tmp = (char *) malloc(strlen(s)+1); // new line 68 adds +1 In the attached file t.c, you will find the corrected version of line 68, just like above. I do not understand the malloc mechanism (sadly, i will appreciate any links for reading as much as a gift), and this is why I do not see (I may be just way too dizzy) the logic of why adding +1 fixes the problem. Please note that adding +1 is not necessary on Linux, I just tested it, but on FreeBSD without adding +1, in rare situations like the one I presented it will crash exactly like I described. Linux works fine on all situations, including this one which crashes on FreeBSD (the very same code). If I am just talking crap please forgive me. I really want to understand what's going on, is it me who is doing it the wrong way? The code is just fooling around to get things working properly, it is not beautified and optimized (yet). PS: another possibility is that I have a 1 byte overflow inside the string pointed to by *s, even before calling the adjust_spaces(char *s) function; but I simply cannot focus anymore,so please help me a bit. Thanks for your time. Sincerely Yours, -- Alin-Adrian Anton Reversed Hell Networks GPG keyID 0x1E2FFF2E (2963 0C11 1AF1 96F6 0030 6EE9 D323 639D 1E2F FF2E) gpg --keyserver pgp.mit.edu --recv-keys 1E2FFF2E --------------060702070401020708010807 Content-Type: text/plain; name="t.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="t.c" #include #include char *remove_comments(char *s) { char *tmp; int i=0; tmp=(char*) malloc (strlen(s)); while ((s[i]!='\0') && (s[i]!='#')) { tmp[i]=s[i]; i++; } tmp[i]='\0'; return tmp; } char *remove_unallowed(char *s) { char *tmp; int i=0,j=0; tmp=(char*) malloc(strlen(s)); while (s[i]!='\0') { if ( (isalnum(s[i])) || (isspace(s[i])) || (s[i]==',') || (s[i]=='_') || (s[i]=='.') ) { tmp[j]=s[i]; j++; } i++; } tmp[j]='\0'; return tmp; } char *remove_unallowed_section(char *s) { char *tmp; int i=0,j=0; tmp=(char*) malloc(strlen(s)); while (s[i]!='\0') { if ( (isalnum(s[i])) || (s[i]=='_') ) { tmp[j]=s[i]; j++; } i++; } tmp[j]='\0'; return tmp; } char *adjust_spaces(char *s) { char *tmp; int i=0,j=0,count=0; int is_leading=0,last_space=0; tmp = (char *) malloc(strlen(s)+1); //fprintf(stderr,"Converting |%s| length=%d\n",s,strlen(s)); while (s[i]!='\0') { //fprintf(stderr,"i=%d j=%d len=%d s[len]=%d\n",i,j,strlen(s),s[strlen(s)]); //fprintf(stderr,"tmp= |%s|\n",tmp); //sleep(1); if (isspace(s[i])) { //fprintf(stderr,"s1=|%s|\n",s); if (is_leading==0) is_leading=1; if ((!count) && (is_leading!=1)) { tmp[j]=s[i]; j++; } if (is_leading==1) is_leading=-1; count++; } else { //fprintf(stderr,"s2=|%s|\n",s); is_leading=-1; count=0; tmp[j]=s[i]; j++; } i++; } // end while if (isspace(tmp[j-1])) --j; tmp[j]='\0'; return tmp; } int is_section(char *s) { int i; int br_left=0,br_right=0; char *tmp; s=remove_comments(s); for (i=0;i0) && (i Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A41116A4CE for ; Sat, 24 Apr 2004 11:44:25 -0700 (PDT) Received: from pc5.i.0x5.de (n.0x5.de [213.146.113.119]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA52643D1D for ; Sat, 24 Apr 2004 11:44:23 -0700 (PDT) (envelope-from nicolas@pc5.i.0x5.de) Received: from pc5.i.0x5.de (nicolas@localhost [127.0.0.1]) by pc5.i.0x5.de (8.12.9p2/8.12.9) with ESMTP id i3OIiICh026076; Sat, 24 Apr 2004 20:44:18 +0200 (CEST) (envelope-from nicolas@pc5.i.0x5.de) Received: (from nicolas@localhost) by pc5.i.0x5.de (8.12.9p2/8.12.9/Submit) id i3OIiIY9026075; Sat, 24 Apr 2004 20:44:18 +0200 (CEST) (envelope-from nicolas) Date: Sat, 24 Apr 2004 20:44:18 +0200 From: Nicolas Rachinsky To: Anton Alin-Adrian Message-ID: <20040424184418.GA25917@pc5.i.0x5.de> Mail-Followup-To: Anton Alin-Adrian , freebsd-hackers@freebsd.org References: <408AB18B.9020906@reversedhell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <408AB18B.9020906@reversedhell.net> X-Powered-by: FreeBSD X-Homepage: http://www.rachinsky.de X-PGP-Keyid: C11ABC0E X-PGP-Fingerprint: 19DB 8392 8FE0 814A 7362 EEBD A53B 526A C11A BC0E X-PGP-Key: http://www.rachinsky.de/nicolas/nicolas_rachinsky.asc User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD's malloc problem ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 18:44:25 -0000 * Anton Alin-Adrian [2004-04-24 21:27 +0300]: > tmp = (char *) malloc(strlen(s)); // line 68 Hmm, you need strlen(s)+1 bytes to store the string -- don't forget the trailing null byte. Nicolas From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 11:58:36 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F5F816A4CE for ; Sat, 24 Apr 2004 11:58:36 -0700 (PDT) Received: from mail.1plan.net (ns1.1plan.net [216.240.143.74]) by mx1.FreeBSD.org (Postfix) with SMTP id 3E3BC43D3F for ; Sat, 24 Apr 2004 11:58:36 -0700 (PDT) (envelope-from aanton@reversedhell.net) Received: (qmail 41221 invoked by uid 98); 24 Apr 2004 19:04:36 -0000 Received: from aanton@reversedhell.net by cp by uid 101 with qmail-scanner-1.20 (clamscan: 0.65. Clear:RC:1(81.196.32.25):SA:0(-100.0/5.0):. Processed in 1.52002 secs); 24 Apr 2004 19:04:36 -0000 X-Spam-Status: No, hits=-100.0 required=5.0 X-Qmail-Scanner-Mail-From: aanton@reversedhell.net via cp X-Qmail-Scanner: 1.20 (Clear:RC:1(81.196.32.25):SA:0(-100.0/5.0):. Processed in 1.52002 secs) Received: from unknown (HELO reversedhell.net) (81.196.32.25) by ns1.1plan.net with SMTP; 24 Apr 2004 19:04:34 -0000 Message-ID: <408AB8DA.2070209@reversedhell.net> Date: Sat, 24 Apr 2004 21:58:34 +0300 From: Anton Alin-Adrian User-Agent: Mozilla Thunderbird 0.5 (X11/20040303) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <408AB18B.9020906@reversedhell.net> <20040424184418.GA25917@pc5.i.0x5.de> In-Reply-To: <20040424184418.GA25917@pc5.i.0x5.de> X-Enigmail-Version: 0.83.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: FreeBSD's malloc problem ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 18:58:36 -0000 Nicolas Rachinsky wrote: > * Anton Alin-Adrian [2004-04-24 21:27 +0300]: > >> tmp = (char *) malloc(strlen(s)); // line 68 > > > Hmm, you need strlen(s)+1 bytes to store the string -- don't forget > the trailing null byte. > > Nicolas And let there be light... DANG.. well it almost blinded me. I was confusing with char[16], which has the +1 byte for the null terminating, but the malloc(16) hasn't... Probably doesn't crash on Linux because the malloced space is not adjacent. Thanks for the candle. Appologises to everyone. -- Alin-Adrian Anton Reversed Hell Networks GPG keyID 0x1E2FFF2E (2963 0C11 1AF1 96F6 0030 6EE9 D323 639D 1E2F FF2E) gpg --keyserver pgp.mit.edu --recv-keys 1E2FFF2E From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 12:14:46 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D387416A4CE for ; Sat, 24 Apr 2004 12:14:46 -0700 (PDT) Received: from mail.eecs.harvard.edu (bowser.eecs.harvard.edu [140.247.60.24]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FFCB43D5A for ; Sat, 24 Apr 2004 12:14:46 -0700 (PDT) (envelope-from ellard@eecs.harvard.edu) Received: by mail.eecs.harvard.edu (Postfix, from userid 465) id 168FB54C74C; Sat, 24 Apr 2004 15:14:46 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.eecs.harvard.edu (Postfix) with ESMTP id 140EB54C712; Sat, 24 Apr 2004 15:14:46 -0400 (EDT) Date: Sat, 24 Apr 2004 15:14:46 -0400 (EDT) From: Daniel Ellard To: Anton Alin-Adrian Message-ID: <20040424150618.S35754@bowser.eecs.harvard.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD's malloc problem ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 19:14:46 -0000 > And let there be light... DANG.. well it almost blinded me. I was > confusing with char[16], which has the +1 byte for the null > terminating, but the malloc(16) hasn't... No, that's still not quite it... char[16] allocates exactly 16 characters. Period. There's no extra space on the end for the terminating nul. If you try to put a sixteen character string into this array, the terminating nul will slop over onto whatever follows this array in memory. malloc(16) is essentially the same. The difference is that there might not be something right there to be clobbered. malloc tends to round up the number of bytes to something convenient. It's easier to manage a pool of things that are all the same size than a zillion different sizes. 16 is pretty small -- the linux malloc might round everything smaller than 20 bytes or 24 bytes (why 20 or 24? That's another story...) to 20 or 24 bytes bytes just to make its life easier. Therefore it's giving you four "extra" bytes and the nul can clobber them without causing you to notice the bug. -Dan From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 12:26:08 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 527AE16A4CE for ; Sat, 24 Apr 2004 12:26:08 -0700 (PDT) Received: from mail.1plan.net (ns1.1plan.net [216.240.143.74]) by mx1.FreeBSD.org (Postfix) with SMTP id 3589943D5A for ; Sat, 24 Apr 2004 12:26:08 -0700 (PDT) (envelope-from aanton@reversedhell.net) Received: (qmail 44218 invoked by uid 98); 24 Apr 2004 19:32:08 -0000 Received: from aanton@reversedhell.net by cp by uid 101 with qmail-scanner-1.20 (clamscan: 0.65. Clear:RC:1(81.196.32.25):SA:0(-100.0/5.0):. Processed in 1.415638 secs); 24 Apr 2004 19:32:08 -0000 X-Spam-Status: No, hits=-100.0 required=5.0 X-Qmail-Scanner-Mail-From: aanton@reversedhell.net via cp X-Qmail-Scanner: 1.20 (Clear:RC:1(81.196.32.25):SA:0(-100.0/5.0):. Processed in 1.415638 secs) Received: from unknown (HELO reversedhell.net) (81.196.32.25) by ns1.1plan.net with SMTP; 24 Apr 2004 19:32:07 -0000 Message-ID: <408ABF4E.5020106@reversedhell.net> Date: Sat, 24 Apr 2004 22:26:06 +0300 From: Anton Alin-Adrian User-Agent: Mozilla Thunderbird 0.5 (X11/20040303) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Ellard References: <20040424150618.S35754@bowser.eecs.harvard.edu> In-Reply-To: <20040424150618.S35754@bowser.eecs.harvard.edu> X-Enigmail-Version: 0.83.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD's malloc problem ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 19:26:08 -0000 Daniel Ellard wrote: > >>And let there be light... DANG.. well it almost blinded me. I was >>confusing with char[16], which has the +1 byte for the null >>terminating, but the malloc(16) hasn't... > > > No, that's still not quite it... > > char[16] allocates exactly 16 characters. Period. There's no extra > space on the end for the terminating nul. If you try to put a sixteen > character string into this array, the terminating nul will slop over > onto whatever follows this array in memory. > > malloc(16) is essentially the same. The difference is that there > might not be something right there to be clobbered. malloc tends to > round up the number of bytes to something convenient. It's easier to > manage a pool of things that are all the same size than a zillion > different sizes. 16 is pretty small -- the linux malloc might round > everything smaller than 20 bytes or 24 bytes (why 20 or 24? That's > another story...) to 20 or 24 bytes bytes just to make its life > easier. Therefore it's giving you four "extra" bytes and the nul can > clobber them without causing you to notice the bug. > > -Dan > Yes. Thanks ;). -- Alin-Adrian Anton Reversed Hell Networks GPG keyID 0x1E2FFF2E (2963 0C11 1AF1 96F6 0030 6EE9 D323 639D 1E2F FF2E) gpg --keyserver pgp.mit.edu --recv-keys 1E2FFF2E From owner-freebsd-hackers@FreeBSD.ORG Sat Apr 24 13:45:34 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5752416A4CE for ; Sat, 24 Apr 2004 13:45:34 -0700 (PDT) Received: from mizar.origin-it.net (mizar.origin-it.net [194.8.96.234]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EA0843D2D for ; Sat, 24 Apr 2004 13:45:33 -0700 (PDT) (envelope-from Helge.Oldach@atosorigin.com) Received: from matar.hbg.de.int.atosorigin.com (dehsfw3e.origin-it.net [194.8.96.68])i3OKj9tH006656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 24 Apr 2004 22:45:10 +0200 (CEST) (envelope-from Helge.Oldach@atosorigin.com) Received: from dehhx004.hbg.de.int.atosorigin.com (dehhx004.hbg.de.int.atosorigin.com [161.90.164.40]) ESMTP id i3OKj9Iq008034; Sat, 24 Apr 2004 22:45:09 +0200 (CEST) (envelope-from Helge.Oldach@atosorigin.com) Received: by dehhx004.hbg.de.int.atosorigin.com with Internet Mail Service (5.5.2657.72) id ; Sat, 24 Apr 2004 22:45:09 +0200 Message-ID: From: "Oldach, Helge" To: "'Sam Leffler'" Date: Sat, 24 Apr 2004 22:45:07 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="windows-1252" cc: freebsd-hackers@freebsd.org cc: Mike Tancsa Subject: RE: FAST_IPSEC bug fix X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Apr 2004 20:45:34 -0000 > From: Sam Leffler [mailto:sam@errno.com] > On Apr 24, 2004, at 11:24 AM, Mike Tancsa wrote: > > At 12:56 PM 24/04/2004, Sam Leffler wrote: > >> On Apr 24, 2004, at 9:03 AM, Oldach, Helge wrote: > >> > >>> Hi list, > >>> > >>> this is a month-old mail about the lack of a FAST_IPSEC feature > >>> compared to legacy IPSEC. Including a working patch. I haven't > >>> seen this being > >>> committed, or is it? Please also MFC to STABLE. > >> > >> The fix was not quite right for -current (where it needs to go in > >> first). I sent out the attached patch for testing but received no > >> feedback. Until I can get it tested and committed to -current it > >> won't be MFC'd. > > > > We dont run -current here, so I dont have anything to test it on. > > Also, due to the bugs in the driver with HiFn 7955, we have had to > > abandon FAST_IPSEC :( > > Running FAST IPSEC w/o h/w crypto is still faster than KAME > IPsec. See the results in my BSDCon paper. Yes, but still the net.key.preferred_oldsa issue hits, which is what this thread is about. FAST_IPSEC is great, but unfortuantely useless for me without this... Sorry for beating this topic again. Unfortunately, like Mike, I don't have a -current system around. Maybe someone with a -current box can test? Helge