From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 26 00:53: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 DE4AD16A4CE for ; Sun, 26 Sep 2004 00:53:26 +0000 (GMT) Received: from santiago.pacific.net.sg (santiago.pacific.net.sg [203.120.90.135]) by mx1.FreeBSD.org (Postfix) with SMTP id DE99F43D53 for ; Sun, 26 Sep 2004 00:53:25 +0000 (GMT) (envelope-from oceanare@pacific.net.sg) Received: (qmail 7522 invoked from network); 26 Sep 2004 00:53:24 -0000 Received: from unknown (HELO maxwell2.pacific.net.sg) (203.120.90.192) by santiago with SMTP; 26 Sep 2004 00:53:24 -0000 Received: from [192.168.0.107] ([210.24.202.141]) by maxwell2.pacific.net.sg with ESMTP <20040926005324.FOFJ27058.maxwell2.pacific.net.sg@[192.168.0.107]>; Sun, 26 Sep 2004 08:53:24 +0800 Message-ID: <415612EC.9010805@pacific.net.sg> Date: Sun, 26 Sep 2004 08:53:00 +0800 From: Erich Dollansky User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: jromero@save-ferris.com References: <18553.192.168.2.11.1096151640.squirrel@192.168.2.11> In-Reply-To: <18553.192.168.2.11.1096151640.squirrel@192.168.2.11> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: SMP on quad xeons 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, 26 Sep 2004 00:53:27 -0000 Hi, jromero@save-ferris.com wrote: > Posted to freebsd-smp but didn't get too many replies, so I apologize for I am on that list too but I can't remember your posting. > cross posting ahead of time. Need to configure groupware server and > multiprotocol wireless proxy for aproximatly 2500 accounts. Application > is heavily multi threaded and willrequire alot of CPU power. The OS will > be FreeBSD 5.x Thinking of going with ServerWorks* Grand Champion HE quad > xeon server board. Has anyone had any SMP experience with quad xeon I read on the list several times that FreeBSD has problems when 6 or more CPUs are in a box. You could be affected by this if HTT is enabled. There is currently a lot of development around the new scheduler (ULE) which will be usable very soon. Check the mailing list to find out more. Another thing. Did you consider Opterons? Tyan has a board with four of them. You would not be affected by the 6-8 CPU 'problem'. > systems on freebsd 5.x??? I'm curious to know if anyone experienced > any major technical stumbling blocks. I guess I also want to know how > well Freebsd 5.x will scale on a 4 proc. Will freeBSD 5.x utilize > a quad xeon board as efficiently as linux2.6 system ?? > I cannot tell as I never used Linux. I run FreeBSD on a Dual-Athlon with the old scheduler (BSD). My experience is that this scheduler is not as good as the one you find on Solaris or HP-UX. This is also the reason why the new one was developed. Erich From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 26 00:58: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 4439216A4CE; Sun, 26 Sep 2004 00:58:57 +0000 (GMT) Received: from multiplay.co.uk (www1.multiplay.co.uk [212.42.16.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34D3743D2D; Sun, 26 Sep 2004 00:58:56 +0000 (GMT) (envelope-from killing@multiplay.co.uk) Received: from stevenp4 ([193.123.241.40]) by multiplay.co.uk (multiplay.co.uk [212.42.16.7]) (MDaemon.PRO.v7.2.0.R) with ESMTP id md50000581229.msg; Sun, 26 Sep 2004 01:52:31 +0100 Message-ID: <0afe01c4a363$efb1c030$7f06000a@int.mediasurface.com> From: "Steven Hartland" To: "Erich Dollansky" , References: <18553.192.168.2.11.1096151640.squirrel@192.168.2.11> <415612EC.9010805@pacific.net.sg> Date: Sun, 26 Sep 2004 01:58:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Spam-Processed: multiplay.co.uk, Sun, 26 Sep 2004 01:52:31 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 193.123.241.40 X-Return-Path: killing@multiplay.co.uk X-MDAV-Processed: multiplay.co.uk, Sun, 26 Sep 2004 01:52:32 +0100 cc: freebsd-hackers@freebsd.org cc: freebsd-smp@freebsd.org Subject: Re: SMP on quad xeons 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, 26 Sep 2004 00:58:57 -0000 My experience with the current SMP kernel is it works very well on a 4 CPU opteron. That was 5.x-CURRENT a few months back at that point the new ULE scheduler was unusable as in it caused major delays in processing server apps. switched back to the old BSD one and all was good. Not sure it these issues have been fixed recently ( I hope so ). Steve ----- Original Message ----- From: "Erich Dollansky" > jromero@save-ferris.com wrote: >> Posted to freebsd-smp but didn't get too many replies, so I apologize for > > I am on that list too but I can't remember your posting. > >> cross posting ahead of time. Need to configure groupware server and >> multiprotocol wireless proxy for aproximatly 2500 accounts. Application >> is heavily multi threaded and willrequire alot of CPU power. The OS will >> be FreeBSD 5.x Thinking of going with ServerWorks* Grand Champion HE quad >> xeon server board. Has anyone had any SMP experience with quad xeon > > I read on the list several times that FreeBSD has problems when 6 or > more CPUs are in a box. You could be affected by this if HTT is enabled. > > There is currently a lot of development around the new scheduler (ULE) > which will be usable very soon. Check the mailing list to find out more. > > Another thing. Did you consider Opterons? Tyan has a board with four of > them. You would not be affected by the 6-8 CPU 'problem'. > >> systems on freebsd 5.x??? I'm curious to know if anyone experienced >> any major technical stumbling blocks. I guess I also want to know how >> well Freebsd 5.x will scale on a 4 proc. Will freeBSD 5.x utilize >> a quad xeon board as efficiently as linux2.6 system ?? >> > I cannot tell as I never used Linux. > > I run FreeBSD on a Dual-Athlon with the old scheduler (BSD). My > experience is that this scheduler is not as good as the one you find on > Solaris or HP-UX. This is also the reason why the new one was developed. ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone (023) 8024 3137 or return the E.mail to postmaster@multiplay.co.uk. From owner-freebsd-hackers@FreeBSD.ORG Sun Sep 26 06:38: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 BB51616A4CE for ; Sun, 26 Sep 2004 06:38:54 +0000 (GMT) Received: from hq.sectorb.msk.ru (petaflop.b.gz.ru [217.67.124.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id C548843D1D for ; Sun, 26 Sep 2004 06:38:52 +0000 (GMT) (envelope-from chinhngt@sectorb.msk.ru) Received: from unix.local (unix.local [172.16.12.120]) by hq.sectorb.msk.ru (Postfix) with ESMTP id 504CD956 for ; Sun, 26 Sep 2004 10:38:50 +0400 (MSD) Date: Sun, 26 Sep 2004 10:40:58 +0400 (MSD) From: Nguyen Tam Chinh X-X-Sender: chinhngt@chinhngt.b.gz.ru To: hackers@freebsd.org Message-ID: <20040926102101.J663@chinhngt.b.gz.ru> X-System: FreeBSD 4.9 STABLEi386 X-Website: http://www.svmgu.com/personal/chinhngt/ X-Home-Addr: Vietnam_SR:Hue-city:45-Le_Huan-st X-Current-Addr: Russian_Federation:Moscow:119234:Main_Building-MSU:Sector_B:Room_539 Keywords: 216091683 MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-817650191-1096180858=:663" Subject: Kernel trap 9 [FreeBSD 4.9] 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, 26 Sep 2004 06:38:54 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-817650191-1096180858=:663 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi All, After getting up this morning, I saw these dead lines on my screen: %Kernel trap 9 with interrupts disabled Fatal trap 9: general protection fault while in kernel mode Instruction pointer = 0x1d:0x2813d428 Stack pointer = 0x10:0xdb32ffe8 frame pointer = 0x10:0xbfbffc00 Code segment = base 0x0, limit 0xfffff, type 0x13 = DPL 0, pres 1, def32 1, gran 1 processor eflags = interrupt enabled, IOPL = 0 current process = 4863 (ginifeed) interrupt mask = none trap number = 9 panic = general proctection fault Syncing disks ... All information in in the attached files. PS. %gcc -v Using builtin specs. gcc version 2.95.4 20020320 [FreeBSD] % ----- With best regards, | The Power to Serve Nguyen Tam Chinh | http://www.FreeBSD.org --0-817650191-1096180858=:663 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=kernel-config Content-Transfer-Encoding: BASE64 Content-ID: <20040926104058.X663@chinhngt.b.gz.ru> Content-Description: Content-Disposition: attachment; filename=kernel-config IyAkRnJlZUJTRDogc3JjL3N5cy9pMzg2L2NvbmYvR0VORVJJQyx2IDEuMjQ2 LjIuNTEuMi4yIDIwMDMvMDMvMjUgMjM6MzU6MTUgamhiIEV4cCAkDQptYWNo aW5lCQlpMzg2DQpjcHUJCUk2ODZfQ1BVDQppZGVudAkJR0VORVJJQw0KbWF4 dXNlcnMJMA0KDQptYWtlb3B0aW9ucwlDT1BURkxBR1M9Ii1PMiAtcGlwZSAt ZnVucm9sbC1sb29wcyAtZmZhc3QtbWF0aCINCg0Kb3B0aW9ucwkJQ1BVX0VO QUJMRV9TU0UJCSNQLklWL0NlbGVyb24gZmVhdHVyZQ0Kb3B0aW9ucwkJQ1BV X0ZBU1RFUl81WDg2X0ZQVQkjdXAgZnB1DQpvcHRpb25zCQlVU0VSX0xEVAkJ I3dpbGwgYmUgZGVmYXVsdCBpbiBGcmVlQlNEIDUNCm9wdGlvbnMJCVBOUEJJ T1MJCQkjUGx1Zy1uLVBsYXkgQklPUyBzdXBwb3J0DQpvcHRpb25zIAlJTkVU CQkJI0ludGVyTkVUd29ya2luZw0Kb3B0aW9ucyAJRkZTCQkJI0JlcmtlbGV5 IEZhc3QgRmlsZXN5c3RlbQ0Kb3B0aW9ucyAJRkZTX1JPT1QJCSNGRlMgdXNh YmxlIGFzIHJvb3QgZGV2aWNlIFtrZWVwIHRoaXMhXQ0Kb3B0aW9ucyAJU09G VFVQREFURVMJCSNFbmFibGUgRkZTIHNvZnQgdXBkYXRlcyBzdXBwb3J0DQpv cHRpb25zIAlVRlNfRElSSEFTSAkJI0ltcHJvdmUgcGVyZm9ybWFuY2Ugb24g YmlnIGRpcmVjdG9yaWVzDQpvcHRpb25zIAlNU0RPU0ZTCQkJI01TRE9TIEZp bGVzeXN0ZW0NCm9wdGlvbnMgCUNEOTY2MAkJCSNJU08gOTY2MCBGaWxlc3lz dGVtDQpvcHRpb25zIAlQUk9DRlMJCQkjUHJvY2VzcyBmaWxlc3lzdGVtDQpv cHRpb25zIAlDT01QQVRfNDMJCSNDb21wYXRpYmxlIHdpdGggQlNEIDQuMyBb S0VFUCBUSElTIV0NCm9wdGlvbnMgCVVDT05TT0xFCQkjQWxsb3cgdXNlcnMg dG8gZ3JhYiB0aGUgY29uc29sZQ0Kb3B0aW9ucyAJVVNFUkNPTkZJRwkJI2Jv b3QgLWMgZWRpdG9yDQpvcHRpb25zIAlWSVNVQUxfVVNFUkNPTkZJRwkjdmlz dWFsIGJvb3QgLWMgZWRpdG9yDQpvcHRpb25zIAlLVFJBQ0UJCQkja3RyYWNl KDEpIHN1cHBvcnQNCm9wdGlvbnMgCVNZU1ZTSE0JCQkjU1lTVi1zdHlsZSBz aGFyZWQgbWVtb3J5DQpvcHRpb25zIAlTWVNWTVNHCQkJI1NZU1Ytc3R5bGUg bWVzc2FnZSBxdWV1ZXMNCm9wdGlvbnMgCVNZU1ZTRU0JCQkjU1lTVi1zdHls ZSBzZW1hcGhvcmVzDQpvcHRpb25zIAlQMTAwM18xQgkJI1Bvc2l4IFAxMDAz XzFCIHJlYWwtdGltZSBleHRlbnNpb25zDQpvcHRpb25zIAlfS1BPU0lYX1BS SU9SSVRZX1NDSEVEVUxJTkcNCm9wdGlvbnMgCUtCRF9JTlNUQUxMX0NERVYJ IyBpbnN0YWxsIGEgQ0RFViBlbnRyeSBpbiAvZGV2DQpvcHRpb25zIAlBSENf UkVHX1BSRVRUWV9QUklOVAkjIFByaW50IHJlZ2lzdGVyIGJpdGZpZWxkcyBp biBkZWJ1Zw0KCQkJCQkjIG91dHB1dC4gIEFkZHMgfjEyOGsgdG8gZHJpdmVy Lg0Kb3B0aW9ucyAJQUhEX1JFR19QUkVUVFlfUFJJTlQJIyBQcmludCByZWdp c3RlciBiaXRmaWVsZHMgaW4gZGVidWcgDQoJCQkJCSMgb3V0cHV0LiAgQWRk cyB+MjE1ayB0byBkcml2ZXIuDQoNCm9wdGlvbnMJCUlQRklSRVdBTEwJCSNk ZWZhdWx0OiBkZW55IGFsbA0Kb3B0aW9ucwkJSVBESVZFUlQJCSNkaXZlcnQg JiBuYXRkIGltcGxlbWVudGF0aW9uDQpvcHRpb25zCQlJUEZJUkVXQUxMX0RF RkFVTFRfVE9fQUNDRVBUCSNhY2NlcHQgYWxsIGJ5IGRlZmF1bHQNCm9wdGlv bnMgCVNDX0RJU0FCTEVfUkVCT09UCSNObyBjdGwtYWx0LWRlbCBvbiBjb25z b2xlDQpvcHRpb25zCQlTQ19QSVhFTF9NT0RFCQkjUmFzdGVyIHRleHQgbW9k ZQ0Kb3B0aW9ucwkJU0NfSElTVE9SWV9TSVpFPTQwMAkjSW5jcmVhc2UgY29u c29sZSBoaXN0b3J5DQpvcHRpb25zCQlWR0FfV0lEVEg5MAkJI0VuYWJsZSA5 MCBjb2x1bW4NCm9wdGlvbnMJCVFVT1RBCQkJI2VuYWJsZSBxdW90YQ0Kb3B0 aW9ucwkJVENQX0RST1BfU1lORklOCQkjZHJvcCBzeW5maW4sIG1ha2Ugbm1h cCB1bnVzYWJsZQ0Kb3B0aW9ucwkJSUNNUF9CQU5ETElNCQkjbGltaXQgYmFk IHJlcGxpZXMNCm9wdGlvbnMJCVZGU19BSU8JCQkjZm9yIHJ1bm5pbmcgdm13 YXJlIDMuMi4xDQpvcHRpb25zCQlIWj0xMDAwCQkJI29wdGltaXplIGZvciBk dW1teSBuZXQgYW5kIHZtd2FyZQ0Kb3B0aW9ucwkJREVWSUNFX1BPTExJTkcJ CSNvcHRpbWl6ZWQgZm9yIGZ4cA0Kb3B0aW9ucwkJRFVNTVlORVQJCSNwdXQg YWxsIGluIHBpcGUgOikNCm9wdGlvbnMJCUJSSURHRQ0KDQpkZXZpY2UgCQlw Y20JCQkjSSB3YW50IHRvIGxpc3RlbiB0byBtdXNpYw0KZGV2aWNlCQlpc2EN CmRldmljZQkJcGNpDQoNCiMgRmxvcHB5IGRyaXZlcw0KZGV2aWNlCQlmZGMw CWF0IGlzYT8gcG9ydCBJT19GRDEgaXJxIDYgZHJxIDINCmRldmljZQkJZmQw CWF0IGZkYzAgZHJpdmUgMA0KDQojIFNDU0kgZW11bGF0b3INCmRldmljZSBz Y2J1cw0KZGV2aWNlIGF0YXBpY2FtDQpkZXZpY2UgY2QNCmRldmljZSBwYXNz DQoNCiMgQVRBIGFuZCBBVEFQSSBkZXZpY2VzDQpkZXZpY2UJCWF0YQ0KZGV2 aWNlCQlhdGFkaXNrCQkJIyBBVEEgZGlzayBkcml2ZXMNCmRldmljZQkJYXRh cGljZAkJCSMgQVRBUEkgQ0RST00gZHJpdmVzDQpvcHRpb25zIAlBVEFfU1RB VElDX0lECQkjU3RhdGljIGRldmljZSBudW1iZXJpbmcNCg0KIyBhdGtiZGMw IGNvbnRyb2xzIGJvdGggdGhlIGtleWJvYXJkIGFuZCB0aGUgUFMvMiBtb3Vz ZQ0KZGV2aWNlCQlhdGtiZGMwCWF0IGlzYT8gcG9ydCBJT19LQkQNCmRldmlj ZQkJYXRrYmQwCWF0IGF0a2JkYz8gaXJxIDEgZmxhZ3MgMHgxICN1c2Ugb25s eSBmb3IgQVQga2INCg0KZGV2aWNlCQlwc20wCWF0IGF0a2JkYz8gaXJxIDEy DQoNCmRldmljZQkJdmdhMAlhdCBpc2E/DQoNCiMgc3BsYXNoIHNjcmVlbi9z Y3JlZW4gc2F2ZXINCnBzZXVkby1kZXZpY2UJc3BsYXNoDQoNCiMgc3lzY29u cyBpcyB0aGUgZGVmYXVsdCBjb25zb2xlIGRyaXZlciwgcmVzZW1ibGluZyBh biBTQ08gY29uc29sZQ0KZGV2aWNlCQlzYzAJYXQgaXNhPyBmbGFncyAweDEw MA0KDQpkZXZpY2UJCWFncAkJIyBzdXBwb3J0IHNldmVyYWwgQUdQIGNoaXBz ZXRzDQpkZXZpY2UJCW1nYWRybQkJIyBmb3IgbXkgbWF0cm94IDQ1MA0KZGV2 aWNlCQlhcG0wCQkjIGFwbSBzdXBwb3J0DQojZGV2aWNlCQlhY3BpY2EJCSMg aSBjYW4gc2xlZXAgbm93ISEhDQoNCiMgRmxvYXRpbmcgcG9pbnQgc3VwcG9y dCAtIGRvIG5vdCBkaXNhYmxlLg0KZGV2aWNlCQlucHgwCWF0IG5leHVzPyBw b3J0IElPX05QWCBpcnEgMTMNCg0KZGV2aWNlCQltaWlidXMJCSMgTUlJIGJ1 cyBzdXBwb3J0DQpkZXZpY2UJCWZ4cAkJIyBJbnRlbCBFdGhlckV4cHJlc3Mg UFJPLzEwMEIgKDgyNTU3LCA4MjU1OCkNCmRldmljZQkJcmwJCSMgUmVhbFRl ayA4MTI5LzgxMzkNCg0KcHNldWRvLWRldmljZQlsb29wCQkjIE5ldHdvcmsg bG9vcGJhY2sNCnBzZXVkby1kZXZpY2UJZXRoZXIJCSMgRXRoZXJuZXQgc3Vw cG9ydA0KcHNldWRvLWRldmljZQlwcHAJMQkjIEtlcm5lbCBQUFANCnBzZXVk by1kZXZpY2UJdHVuCTEwCSMgUGFja2V0IHR1bm5lbC4NCnBzZXVkby1kZXZp Y2UJcHR5CQkjIFBzZXVkby10dHlzICh0ZWxuZXQgZXRjKQ0KcHNldWRvLWRl dmljZQl2bgkJIyBmb3IgdXNpbmcgZmlsZSBhcyBkZXZpY2UNCnBzZXVkby1k ZXZpY2UJYnBmCTQwCSMgQmVya2VsZXkgcGFja2V0IGZpbHRlcg0K --0-817650191-1096180858=:663 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=uname Content-Transfer-Encoding: BASE64 Content-ID: <20040926104058.E663@chinhngt.b.gz.ru> Content-Description: Content-Disposition: attachment; filename=uname RnJlZUJTRCBjaGluaG5ndC5iLmd6LnJ1IDQuOS1SRUxFQVNFLXA1IEZyZWVC U0QgNC45LVJFTEVBU0UtcDUgIzA6IFN1biBNYXkgIDkgMTY6MDY6MDUgTVNE IDIwMDQgICAgIHJvb3RAY2hpbmhuZ3QuYi5nei5ydTovbW50L211c2ljL1Rl bXAvb2JqL3Vzci9zcmMvc3lzL0ZJTkFMS0VSTkVMLWk2ODYgIGkzODYNCg== --0-817650191-1096180858=:663 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=dmesg Content-Transfer-Encoding: BASE64 Content-ID: <20040926104058.H663@chinhngt.b.gz.ru> Content-Description: Content-Disposition: attachment; filename=dmesg Q29weXJpZ2h0IChjKSAxOTkyLTIwMDMgVGhlIEZyZWVCU0QgUHJvamVjdC4N CkNvcHlyaWdodCAoYykgMTk3OSwgMTk4MCwgMTk4MywgMTk4NiwgMTk4OCwg MTk4OSwgMTk5MSwgMTk5MiwgMTk5MywgMTk5NA0KCVRoZSBSZWdlbnRzIG9m IHRoZSBVbml2ZXJzaXR5IG9mIENhbGlmb3JuaWEuIEFsbCByaWdodHMgcmVz ZXJ2ZWQuDQpGcmVlQlNEIDQuOS1SRUxFQVNFLXA1ICMwOiBTdW4gTWF5ICA5 IDE2OjA2OjA1IE1TRCAyMDA0DQogICAgcm9vdEBjaGluaG5ndC5iLmd6LnJ1 Oi9tbnQvbXVzaWMvVGVtcC9vYmovdXNyL3NyYy9zeXMvRklOQUxLRVJORUwt aTY4Ng0KVGltZWNvdW50ZXIgImk4MjU0IiAgZnJlcXVlbmN5IDExOTMxODIg SHoNCkNQVTogSW50ZWwoUikgQ2VsZXJvbihSKSBDUFUgMS44MEdIeiAoMTc5 Mi43My1NSHogNjg2LWNsYXNzIENQVSkNCiAgT3JpZ2luID0gIkdlbnVpbmVJ bnRlbCIgIElkID0gMHhmMTMgIFN0ZXBwaW5nID0gMw0KICBGZWF0dXJlcz0w eDNmZWJmYmZmPEZQVSxWTUUsREUsUFNFLFRTQyxNU1IsUEFFLE1DRSxDWDgs QVBJQyxTRVAsTVRSUixQR0UsTUNBLENNT1YsUEFULFBTRTM2LENMRkxVU0gs RFRTLEFDUEksTU1YLEZYU1IsU1NFLFNTRTIsU1MsSFRULFRNPg0KcmVhbCBt ZW1vcnkgID0gNTM2ODA1Mzc2ICg1MjQyMjRLIGJ5dGVzKQ0KYXZhaWwgbWVt b3J5ID0gNTE4NzY2NTkyICg1MDY2MDhLIGJ5dGVzKQ0KUHJlbG9hZGVkIGVs ZiBrZXJuZWwgImtlcm5lbCIgYXQgMHhjMDM3MjAwMC4NCldhcm5pbmc6IFBl bnRpdW0gNCBDUFU6IFBTRSBkaXNhYmxlZA0KUGVudGl1bSBQcm8gTVRSUiBz dXBwb3J0IGVuYWJsZWQNClVzaW5nICRQSVIgdGFibGUsIDYgZW50cmllcyBh dCAweGMwMGZkZTcwDQphcG0wOiA8QVBNIEJJT1M+IG9uIG1vdGhlcmJvYXJk DQphcG0wOiBmb3VuZCBBUE0gQklPUyB2MS4yLCBjb25uZWN0ZWQgYXQgdjEu Mg0KbnB4MDogPG1hdGggcHJvY2Vzc29yPiBvbiBtb3RoZXJib2FyZA0KbnB4 MDogSU5UIDE2IGludGVyZmFjZQ0KcGNpYjA6IDxIb3N0IHRvIFBDSSBicmlk Z2U+IG9uIG1vdGhlcmJvYXJkDQpwY2kwOiA8UENJIGJ1cz4gb24gcGNpYjAN CmFncDA6IDxTSVMgR2VuZXJpYyBob3N0IHRvIFBDSSBicmlkZ2U+IG1lbSAw eGUwMDAwMDAwLTB4ZTNmZmZmZmYgYXQgZGV2aWNlIDAuMCBvbiBwY2kwDQpw Y2liMjogPFBDSSB0byBQQ0kgYnJpZGdlICh2ZW5kb3I9MTAzOSBkZXZpY2U9 MDAwMSk+IGF0IGRldmljZSAxLjAgb24gcGNpMA0KcGNpMTogPFBDSSBidXM+ IG9uIHBjaWIyDQpkcm0wOiA8TWF0cm94IEc0MDAvRzQ1MCAoQUdQKT4gbWVt IDB4YzcwMDAwMDAtMHhjNzdmZmZmZiwweGM2MDAwMDAwLTB4YzYwMDNmZmYs MHhjNDAwMDAwMC0weGM1ZmZmZmZmIGlycSA1IGF0IGRldmljZSAwLjAgb24g cGNpMQ0KaW5mbzogW2RybV0gQUdQIGF0IDB4ZTAwMDAwMDAgNjRNQg0KaW5m bzogW2RybV0gSW5pdGlhbGl6ZWQgbWdhIDMuMS4wIDIwMDIxMDI5IG9uIG1p bm9yIDANCmlzYWIwOiA8U2lTIDg1YzUwMyBQQ0ktSVNBIGJyaWRnZT4gYXQg ZGV2aWNlIDIuMCBvbiBwY2kwDQppc2EwOiA8SVNBIGJ1cz4gb24gaXNhYjAN CnBjaTA6IDxPSENJIFVTQiBjb250cm9sbGVyPiBhdCAyLjIgaXJxIDExDQpw Y2kwOiA8T0hDSSBVU0IgY29udHJvbGxlcj4gYXQgMi4zIGlycSAxMQ0KYXRh cGNpMDogPFNpUyA1NTkxIEFUQTEwMCBjb250cm9sbGVyPiBwb3J0IDB4NDAw MC0weDQwMGYgYXQgZGV2aWNlIDIuNSBvbiBwY2kwDQphdGEwOiBhdCAweDFm MCBpcnEgMTQgb24gYXRhcGNpMA0KYXRhMTogYXQgMHgxNzAgaXJxIDE1IG9u IGF0YXBjaTANCnBjbTA6IDxTaVMgNzAxMj4gcG9ydCAweGU0MDAtMHhlNDdm LDB4ZTAwMC0weGUwZmYgaXJxIDkgYXQgZGV2aWNlIDIuNyBvbiBwY2kwDQpw Y20wOiA8QXZhbmNlIExvZ2ljIEFMQzIwMCBBQzk3IENvZGVjPg0KZnhwMDog PEludGVsIDgyNTU4IFByby8xMDAgRXRoZXJuZXQ+IHBvcnQgMHhlODAwLTB4 ZTgxZiBtZW0gMHhjYTAwMDAwMC0weGNhMGZmZmZmLDB4Y2ExMDAwMDAtMHhj YTEwMGZmZiBpcnEgMTEgYXQgZGV2aWNlIDcuMCBvbiBwY2kwDQpmeHAwOiBF dGhlcm5ldCBhZGRyZXNzIDAwOmEwOmM5OmU2OjViOmFmDQppbnBoeTA6IDxp ODI1NTUgMTAvMTAwIG1lZGlhIGludGVyZmFjZT4gb24gbWlpYnVzMA0KaW5w aHkwOiAgMTBiYXNlVCwgMTBiYXNlVC1GRFgsIDEwMGJhc2VUWCwgMTAwYmFz ZVRYLUZEWCwgYXV0bw0KcmwwOiA8UmVhbFRlayA4MTM5IDEwLzEwMEJhc2VU WD4gcG9ydCAweGVjMDAtMHhlY2ZmIG1lbSAweGNhMTAzMDAwLTB4Y2ExMDMw ZmYgaXJxIDExIGF0IGRldmljZSAxNS4wIG9uIHBjaTANCnJsMDogRXRoZXJu ZXQgYWRkcmVzczogMDA6MTA6ZGM6NTg6YjA6ZTENCm1paWJ1czE6IDxNSUkg YnVzPiBvbiBybDANCnJscGh5MDogPFJlYWxUZWsgaW50ZXJuYWwgbWVkaWEg aW50ZXJmYWNlPiBvbiBtaWlidXMxDQpybHBoeTA6ICAxMGJhc2VULCAxMGJh c2VULUZEWCwgMTAwYmFzZVRYLCAxMDBiYXNlVFgtRkRYLCBhdXRvDQpwY2li MTogPFNpUyA1NTkxIGhvc3QgdG8gQUdQIGJyaWRnZT4gb24gbW90aGVyYm9h cmQNCnBjaTI6IDxQQ0kgYnVzPiBvbiBwY2liMQ0Kb3JtMDogPE9wdGlvbiBS T00+IGF0IGlvbWVtIDB4YzAwMDAtMHhjODdmZiBvbiBpc2EwDQpwbXRpbWVy MCBvbiBpc2EwDQpmZGMwOiA8TkVDIDcyMDY1QiBvciBjbG9uZT4gYXQgcG9y dCAweDNmMC0weDNmNSwweDNmNyBpcnEgNiBkcnEgMiBvbiBpc2EwDQpmZGMw OiBGSUZPIGVuYWJsZWQsIDggYnl0ZXMgdGhyZXNob2xkDQpmZDA6IDwxNDQw LUtCIDMuNSIgZHJpdmU+IG9uIGZkYzAgZHJpdmUgMA0KYXRrYmRjMDogPEtl eWJvYXJkIGNvbnRyb2xsZXIgKGk4MDQyKT4gYXQgcG9ydCAweDYwLDB4NjQg b24gaXNhMA0KYXRrYmQwOiA8QVQgS2V5Ym9hcmQ+IGZsYWdzIDB4MSBpcnEg MSBvbiBhdGtiZGMwDQprYmQwIGF0IGF0a2JkMA0KcHNtMDogPFBTLzIgTW91 c2U+IGlycSAxMiBvbiBhdGtiZGMwDQpwc20wOiBtb2RlbCBJbnRlbGxpTW91 c2UsIGRldmljZSBJRCAzDQp2Z2EwOiA8R2VuZXJpYyBJU0EgVkdBPiBhdCBw b3J0IDB4M2MwLTB4M2RmIGlvbWVtIDB4YTAwMDAtMHhiZmZmZiBvbiBpc2Ew DQpzYzA6IDxTeXN0ZW0gY29uc29sZT4gYXQgZmxhZ3MgMHgxMDAgb24gaXNh MA0Kc2MwOiBWR0EgPDE2IHZpcnR1YWwgY29uc29sZXMsIGZsYWdzPTB4MzAw Pg0KdW5rbm93bjogPFBOUDAwMDA+IGNhbid0IGFzc2lnbiByZXNvdXJjZXMN CnVua25vd246IDxQTlAwMzAzPiBjYW4ndCBhc3NpZ24gcmVzb3VyY2VzDQp1 bmtub3duOiA8UE5QMGYxMz4gY2FuJ3QgYXNzaWduIHJlc291cmNlcw0KdW5r bm93bjogPFBOUDBjMDI+IGNhbid0IGFzc2lnbiByZXNvdXJjZXMNCnVua25v d246IDxQTlAwNzAwPiBjYW4ndCBhc3NpZ24gcmVzb3VyY2VzDQpJUCBwYWNr ZXQgZmlsdGVyaW5nIGluaXRpYWxpemVkLCBkaXZlcnQgZW5hYmxlZCwgcnVs ZS1iYXNlZCBmb3J3YXJkaW5nIGVuYWJsZWQsIGRlZmF1bHQgdG8gYWNjZXB0 LCBsb2dnaW5nIGRpc2FibGVkDQpEVU1NWU5FVCBpbml0aWFsaXplZCAoMDEx MDMxKQ0KQlJJREdFIDAyMDIxNCBsb2FkZWQNCmFkMDogMzgxNjZNQiA8U1Qz NDAwMTZBPiBbNzc1NDUvMTYvNjNdIGF0IGF0YTAtbWFzdGVyIFVETUExMDAN CmFkMjogMTE3MjQ2TUIgPE1heHRvciA2WTEyMEwwPiBbMjM4MjE2LzE2LzYz XSBhdCBhdGExLW1hc3RlciBVRE1BMTAwDQphY2QwOiBDRC1SVyA8SEwtRFQt U1QgR0NFLTg0ODFCPiBhdCBhdGExLXNsYXZlIFBJTzQNCk1vdW50aW5nIHJv b3QgZnJvbSB1ZnM6L2Rldi9hZDBzMWENCmNkMCBhdCBhdGExIGJ1cyAwIHRh cmdldCAxIGx1biAwDQpjZDA6IDxITC1EVC1TVCBDRC1SVyBHQ0UtODQ4MUIg MS4wMD4gUmVtb3ZhYmxlIENELVJPTSBTQ1NJLTAgZGV2aWNlIA0KY2QwOiAx Ni4wMDBNQi9zIHRyYW5zZmVycw0KY2QwOiBBdHRlbXB0IHRvIHF1ZXJ5IGRl dmljZSBzaXplIGZhaWxlZDogTk9UIFJFQURZLCBNZWRpdW0gbm90IHByZXNl bnQgLSB0cmF5IGNsb3NlZA0KV0FSTklORzogLyB3YXMgbm90IHByb3Blcmx5 IGRpc21vdW50ZWQNCnZtbW9uOiBNb2R1bGUgdm1tb246IHJlZ2lzdGVyZWQg d2l0aCBtYWpvcj0yMDAgbWlub3I9MCB0YWc9JE5hbWU6IGJ1aWxkLTU3MCAo My4yLnggbXZtKSAkDQp2bW1vbjogTW9kdWxlIHZtbW9uOiBpbml0aWFsaXpl ZA0K --0-817650191-1096180858=:663-- From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 07:00: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 E203716A4F4 for ; Mon, 27 Sep 2004 07:00:19 +0000 (GMT) Received: from www.hexe.com.pl (www.hexe.com.pl [212.160.230.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12C9E43D45 for ; Mon, 27 Sep 2004 07:00:19 +0000 (GMT) (envelope-from clamav@www.hexe.com.pl) Received: from www.hexe.com.pl (smmsp@localhost [127.0.0.1]) i8R6SwF3029573; Mon, 27 Sep 2004 08:29:01 +0200 Received: (from clamav@localhost) by www.hexe.com.pl (8.12.3/8.12.3/Debian-6.6) id i8R6S7eo029538; Mon, 27 Sep 2004 08:28:07 +0200 Date: Mon, 27 Sep 2004 08:28:07 +0200 Message-Id: <200409270628.i8R6S7eo029538@www.hexe.com.pl> From: To: Auto-Submitted: auto-submitted (antivirus notify) X-Infected-Received-From: ajs208.neoplus.adsl.tpnet.pl [83.25.252.208] X-Virus-Scanned: clamd / ClamAV version 0.75-1, clamav-milter version 0.74a on www X-Virus-Status: Clean cc: postmaster@www.hexe.com.pl cc: m.sowik@hexe.com.pl Subject: Virus intercepted 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, 27 Sep 2004 07:00:20 -0000 A message you sent to contained Worm.SomeFool.X and has not been delivered. From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 08:34: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 7FC7416A4CE; Mon, 27 Sep 2004 08:34:21 +0000 (GMT) Received: from cs1.cs.huji.ac.il (cs1.cs.huji.ac.il [132.65.16.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id B967043D1F; Mon, 27 Sep 2004 08:34:20 +0000 (GMT) (envelope-from danny@cs.huji.ac.il) Received: from pampa.cs.huji.ac.il ([132.65.80.32]) by cs1.cs.huji.ac.il with esmtp id 1CBqxf-000Csd-Jc; Mon, 27 Sep 2004 10:34:19 +0200 X-Mailer: exmh version 2.7.0 06/18/2004 with nmh-1.0.4 To: John Baldwin In-reply-to: Your message of Thu, 23 Sep 2004 10:07:47 -0400 . Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Mon, 27 Sep 2004 10:34:19 +0200 From: Danny Braniss Message-Id: <20040927083420.B967043D1F@mx1.FreeBSD.org> cc: hackers@freebsd.org Subject: Re: Dell gx280 and acpi problems 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, 27 Sep 2004 08:34:21 -0000 for the short verions goto the end. > On Thursday 23 September 2004 04:29 am, Danny Braniss wrote: > > > On Wednesday 22 September 2004 04:58 am, Danny Braniss wrote: > > > > could some acpi expert shed some light? > > > > > > > > -current panics on boot with BIOS default settings (Suspend Mode = is S3) > > > > fix: set Power Management/Suspend Mode to S1 in BIOS > > > > > > > > disabling ACPI on boot is not good, since this box has no PS/2, a= nd the > > > > USB keyboard/mouse don't work with ACPI off. > > > > > > > > the acpi dumps are available from: > > > > ftp://ftp.cs.huji.ac.il/users/danny/freebsd/gx280 > > > > > > > > this is the panic: > > > > > > > > > > > > KDB: debugger backends: ddb > > > > KDB: current backend: ddb > > > > Copyright (c) 1992-2004 The FreeBSD Project. > > > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 199= 3, > > > > 1994 The Regents of the University of California. All rights rese= rved. > > > > FreeBSD 5.3-BETA5 #14: Tue Sep 21 13:44:32 IDT 2004 > > > > danny@new-dev:/r+d/obj/new-dev/r+d/5.3/src/sys/HUJI > > > > Timecounter "i8254" frequency 1193182 Hz quality 0 > > > > CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (2992.52-MHz 686-class CPU= ) > > > > Origin =3D "GenuineIntel" Id =3D 0xf34 Stepping =3D 4 > > > > > > > > Features=3D0xbfebfbff > > >E,MC A, CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,T= M,PBE> > > > > Hyperthreading: 2 logical CPUs > > > > real memory =3D 1063813120 (1014 MB) > > > > avail memory =3D 1031565312 (983 MB) > > > > kernel trap 12 with interrupts disabled > > > > > > > > > > > > Fatal trap 12: page fault while in kernel mode > > > > cpuid =3D 0; apic id =3D 00 > > > > fault virtual address =3D 0x1c > > > > fault code =3D supervisor write, page not present > > > > instruction pointer =3D 0x8:0xc075dab5 > > > > stack pointer =3D 0x10:0xc0c21be0 > > > > frame pointer =3D 0x10:0xc0c21cac > > > > code segment =3D base 0x0, limit 0xfffff, type 0x1b > > > > =3D DPL 0, pres 1, def32 1, gran 1 > > > > processor eflags =3D interrupt enabled, resume, IOPL =3D 0= > > > > current process =3D 0 () > > > > [thread 0] > > > > Stopped at vm_fault+0x1b1: lock cmpxchgl %ecx,0x1c(%edx) > > > > db> trace > > > > vm_fault(c103a000,c1004000,1,0,c08e36c0) at vm_fault+0x1b1 > > > > trap_pfault(c0c21d14,0,c1004c29) at trap_pfault+0x184 > > > > trap(fffd0018,c1000010,c0c20010,c1004bfd,7) at trap+0x2f1 > > > > calltrap() at calltrap+0x5 > > > > --- trap 0xc, eip =3D 0xc0a18574, esp =3D 0xc0c21d54, ebp =3D 0xc= 0c21d74 --- > > > > madt_probe(c22264f0,c08bb1f0,c0c21d98,c05e8302,0) at madt_probe+0= x174 > > > > apic_init(0,c1ec00,c1e000,0,c0441225) at apic_init+0x47 > > > > mi_startup() at mi_startup+0x96 > > > > begin() at begin+0x2c > > > > > > Can you do a 'gdb kernel.debug' and then do 'l madt_probe+0x174' an= d > > > e-mail the results? > > > > I think i'm doing something wrong :-), tip -38400 com1 works fine, > > Type '?' for a list of commands, 'help' for more detailed help. > > OK boot -d > > /boot/kernel/acpi.ko text=3D0x3fa30 data=3D0x1be4+0x110c > > syms=3D[0x4+0x72a0+0x4+0x9743] > > GDB: debug ports: sio > > GDB: current port: sio > > KDB: debugger backends: ddb gdb > > KDB: current backend: ddb > > KDB: enter: Boot flags requested debugger > > [thread 0] > > Stopped at kdb_enter+0x2b: nop > > db> gdb > > Step to enter the remote GDB backend. > > > > backing out of tip via ~. > > > > > > shuttle-2# gdb -b 38400 kernel.debug > > GNU gdb 6.1.1 [FreeBSD] > > Copyright 2004 Free Software Foundation, Inc. > > GDB is free software, covered by the GNU General Public License, and = you > > are welcome to change it and/or distribute copies of it under certain= > > conditions. Type "show copying" to see the conditions. > > There is absolutely no warranty for GDB. Type "show warranty" for de= tails. > > This GDB was configured as "i386-marcel-freebsd"... > > Ready to go. Enter 'tr' to connect to the remote target > > with /dev/cuaa0, 'tr /dev/cuaa1' to connect to a different port > > or 'trf portno' to connect to the remote target with the firewire > > interface. portno defaults to 5556. > > > > Type 'getsyms' after connection to load kld symbols. > > > > If you're debugging a local system, you can use 'kldsyms' instead > > to load the kld symbols. That's a less obnoxious interface. > > (gdb) tr /dev/cuaa0 > > Ignoring packet error, continuing... > > Ignoring packet error, continuing... > > Ignoring packet error, continuing... > > Couldn't establish connection to remote target > > Malformed response to offset query, timeout > > (gdb) > = > You don't have to do the gdb during the panic. You just need access to= the = > kernel.debug corresponding to the kernel you are booting. Is this a cu= stom = > kernel on the box or are you doing an install? If you are doing an ins= tall, = > try disabling apic support by entering 'set hint.apic.0.disabled=3D1' a= t the = > loader prompt and install that way. Then, once the box is running, bui= ld a = > debug kernel, reproduce the panic, get the instruction pointer address,= and = > then fire up gdb on the kernel.debug file and do 'l * pointer>'. to get gdb talking i had to: db> gdb db> step Fatal trap 12: page fault while in kernel mode cpuid =3D 0; apic id =3D 00 fault virtual address =3D 0x1c fault code =3D supervisor write, page not present instruction pointer =3D 0x8:0xc07673b1 stack pointer =3D 0x10:0xc0c21be0 frame pointer =3D 0x10:0xc0c21cac code segment =3D base 0x0, limit 0xfffff, type 0x1b =3D DPL 0, pres 1, def32 1, gran 1 processor eflags =3D trace trap, interrupt enabled, resume, IOPL =3D= 0 current process =3D 0 () $T0b8:b17376c0;thread:0;#ad~ ^ |--- i typed to get out of db then (not clear from docs, maybe common sense, but you better be in boot/kerne= l) gdb kernel.debug (gdb) l madt_probe+0x174 Junk at end of line specification. so not giving up, and using my 'skills' with gdb (gdb) bt #0 vm_fault (map=3D0xc103a000, vaddr=3D0xc1004000, fault_type=3D0x1, = fault_flags=3D0x0) at atomic.h:154 During symbol reading, Incomplete CFI data; unspecified registers at = 0xc07673d5. #1 0xc07ce128 in trap_pfault (frame=3D0xc0c21d14, usermode=3D0x0, eva=3D= 0xc1004c29) = at /r+d/5.3/src/sys/i386/i3 86/trap.c:716 #2 0xc07cdd91 in trap (frame=3D {tf_fs =3D 0xfffd0018, tf_es =3D 0xc1000010, tf_ds =3D 0xc0c20010, = tf_edi =3D = 0xc1004bfd, tf_esi =3D 0x7, tf_e bp =3D 0xc0c21d74, tf_isp =3D 0xc0c21d40, tf_ebx =3D 0x2, tf_edx =3D 0x12= , tf_ecx =3D = 0x4, tf_eax =3D 0x0, tf_trapno =3D 0xc, tf_err =3D 0x0, tf_eip =3D 0xc0a24574, tf_cs =3D 0x8, tf_eflags =3D= 0x90093, = tf_esp =3D 0xc00fec00, tf_ss =3D 0x 1}) at /r+d/5.3/src/sys/i386/i386/trap.c:417 #3 0xc07bc7aa in calltrap () at /r+d/5.3/src/sys/i386/i386/exception.s:1= 40 #4 0xfffd0018 in ?? () #5 0xc1000010 in ?? () #6 0xc0c20010 in ?? () #7 0xc1004bfd in ?? () #8 0x00000007 in ?? () #9 0xc0c21d74 in ?? () #10 0xc0c21d40 in ?? () #11 0x00000002 in ?? () #12 0x00000012 in ?? () #13 0x00000004 in ?? () #14 0x00000000 in ?? () #15 0x0000000c in ?? () #16 0x00000000 in ?? () #17 0xc0a24574 in madt_probe () at /r+d/5.3/src/sys/modules/acpi/acpi/../= =2E./../ i386/acpica/madt.c:258 #18 0xc07c2757 in apic_init (dummy=3D0x0) at /r+d/5.3/src/sys/i386/i386/l= ocal_api c.c:564 #19 0xc05f1bfe in mi_startup () at /r+d/5.3/src/sys/kern/init_main.c:210 #20 0xc0441225 in begin () at /r+d/5.3/src/sys/i386/i386/locore.s:348 (gdb) frame 17 #17 0xc0a24574 in madt_probe () at /r+d/5.3/src/sys/modules/acpi/acpi/../= =2E./../ i386/acpica/madt.c:258 258 for (i =3D 0; i < count; i++) (gdb) l 253 printf("MADT: Failed to map RSDT\= n"); 254 return (ENXIO); 255 } 256 count =3D (rsdt->Length - sizeof(ACPI_TABLE_HEADE= R)) / 257 sizeof(UINT32); 258 for (i =3D 0; i < count; i++) 259 if (madt_probe_table(rsdt-> TableOffsetEntry[i])) 260 break; 261 madt_unmap_table(rsdt); 262 } the suspicious part: (gdb) p *rsdp $5 =3D { Signature =3D "RSD PTR ", = Checksum =3D 0xa9, = OemId =3D "DELL ", = Revision =3D 0x0, = RsdtPhysicalAddress =3D 0xfcbfd, = Length =3D 0xffffffff, = XsdtPhysicalAddress =3D 0xffffffffffffffff, = ExtendedChecksum =3D 0xff, = Reserved =3D "=FF=FF=FF" } (gdb) p rsdt->Length Cannot access memory at address 0xc1004c01 (gdb) p rsdp->RsdtPhysicalAddress $6 =3D 0xfcbfd rsdp seems to point to valid data, p->RsdtPhysicalAddress also, but rsdt->Length gives an gdb error, and in any case seems wrong (0xffffffff)= =2E so i hope all this helps someone, danny PS: i think i should change the subject to: 'debugging on the Bleeding Ed= ge' From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 17:17:44 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 BE5DB16A4CE for ; Mon, 27 Sep 2004 17:17:44 +0000 (GMT) Received: from mta2.rdslink.ro (emta2.rdslink.ro [193.231.236.63]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E3ED43D3F for ; Mon, 27 Sep 2004 17:17:43 +0000 (GMT) (envelope-from dr.clau@rdslink.ro) Received: (qmail 2457 invoked from network); 27 Sep 2004 17:12:31 -0000 Received: from unknown (HELO mail.rdslink.ro) (193.231.236.20) by emta2.rdslink.ro with SMTP; 27 Sep 2004 17:12:31 -0000 Received: (qmail 25906 invoked from network); 27 Sep 2004 17:17:23 -0000 Received: from unknown (HELO mordor.arsys.ro) (213.157.184.200) by mail.rdslink.ro with SMTP; 27 Sep 2004 17:17:23 -0000 Received: from localhost (jail1 [192.168.0.100]) by mordor.arsys.ro (Postfix) with ESMTP id 1B96BCFA6E for ; Mon, 27 Sep 2004 20:16:47 +0300 (EEST) Received: from mordor.arsys.ro ([192.168.0.100]) by localhost (jail1 [192.168.0.100]) (amavisd-new, port 10024) with ESMTP id 67197-09 for ; Mon, 27 Sep 2004 20:16:45 +0300 (EEST) Received: from [82.79.29.15] (unknown [82.79.29.15]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mordor.arsys.ro (Postfix) with ESMTP id 0594ACFA6D for ; Mon, 27 Sep 2004 20:16:44 +0300 (EEST) Message-ID: <41584B22.7050802@rdslink.ro> Date: Mon, 27 Sep 2004 20:17:22 +0300 From: Claudiu Dragalina-Paraipan User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040807) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at arsys.ro Subject: bridge + pf 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, 27 Sep 2004 17:17:44 -0000 Hello, I would like to know if I can use PF for filtering with FreeBSD bridging support. I understand that both IPFW and IPF are supported. I am using FreeBSD 5.2.1 right now, and I will stick with it until 5.3 release. I saw that this two MIBs exist: net.link.ether.bridge.ipf net.link.ether.bridge.ipfw I assume that one is for ipf and one for ipfw, and I seen nothing related to pf. Or enabling ipf means that I have support for pf too ? Thank you in advance. -- Claudiu Dragalina-Paraipan e-mail: dr.clau@rdslink.ro From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 18:07: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 AEC1516A4CE for ; Mon, 27 Sep 2004 18:07:50 +0000 (GMT) Received: from pony2pub.arc.nasa.gov (pony2pub.arc.nasa.gov [128.102.31.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64A0243D5C for ; Mon, 27 Sep 2004 18:07:48 +0000 (GMT) (envelope-from jtoung@arc.nasa.gov) Received: from mrcrab.nas.nasa.gov ([129.99.139.47] verified) by pony2pub.arc.nasa.gov (CommuniGate Pro SMTP 4.1.8) with ESMTP id 13907550; Mon, 27 Sep 2004 11:07:45 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Jerry Toung To: Mark Teel Date: Mon, 27 Sep 2004 11:07:21 -0700 User-Agent: KMail/1.4.3 References: <200409241628.43022.jtoung@earthlink.net> <200409241648.10308.jtoung@earthlink.net> <4154B97B.7050902@teel.ws> In-Reply-To: <4154B97B.7050902@teel.ws> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200409271107.21241.jtoung@arc.nasa.gov> cc: freebsd-hackers@freebsd.org Subject: remote debugging question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jtoung@arc.nasa.gov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2004 18:07:50 -0000 Good morning list, I CAN connect to the target but the 'bt" command return #0 0x00000000 in= ??=20 () at the remote. So this is what I am doing, hopefully somebody can tell me what I am miss= ing. I have 2 laptops same brand and model, both running 6.0current and same k= ernel=20 config. laptop A panics because of kld I am writing and I want to debug A with la= ptop=20 B. I reboot A and login and enter CTRL-ATL-ESC to get db> prompt, then enter= =20 'gdb', then enter 's'. At this point I don't get the db> prompt anymore a= nd A=20 seems to be in a loop, is that normal? on laptop B, the only thing I did is get the copy of kernel.debug.A in=20 /usr/obj/usr/src/sys/MYKERNEL I 'cd' to that location an run kgdb file kernel.debug.A set remotebaud 1 set remotebreak 1 set debug remote 1 target remote /dev/cuaa0 it connects, on B screen (not using X) I see Warning: Unable to find dynamic linker breakpoint function. GDB will be unable to debug shared library initializers and track explicitly loaded dynamic code. warning: shared library handler failed to enable breakpoint Sending packet: $qSymbol ::#5...Ack Packet Received: Packet qSymbol (symbol-lookup) is NOT supported (kgdb) when I type 'bt', that's where I get #0 0x00000000 in ?? () Please somebody advise since I can't do anything with that. And laptop A = is=20 still hanging/loop, and no prompt. Thanks a lot, Jerry From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 18:56:59 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 24DC316A4D0 for ; Mon, 27 Sep 2004 18:56:59 +0000 (GMT) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5141343D5C for ; Mon, 27 Sep 2004 18:56:58 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 6180 invoked from network); 27 Sep 2004 18:56:58 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 27 Sep 2004 18:56:10 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i8RIsVY3014057; Mon, 27 Sep 2004 14:55:54 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Danny Braniss Date: Mon, 27 Sep 2004 11:31:03 -0400 User-Agent: KMail/1.6.2 References: <20040927083420.B967043D1F@mx1.FreeBSD.org> In-Reply-To: <20040927083420.B967043D1F@mx1.FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200409271131.03437.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: hackers@FreeBSD.org Subject: Re: Dell gx280 and acpi problems 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, 27 Sep 2004 18:56:59 -0000 On Monday 27 September 2004 04:34 am, Danny Braniss wrote: > for the short verions goto the end. > > > On Thursday 23 September 2004 04:29 am, Danny Braniss wrote: > > > > On Wednesday 22 September 2004 04:58 am, Danny Braniss wrote: > > > > > could some acpi expert shed some light? > > > > > > > > > > -current panics on boot with BIOS default settings (Suspend Mode = is > > > > > S3) fix: set Power Management/Suspend Mode to S1 in BIOS > > > > > > > > > > disabling ACPI on boot is not good, since this box has no PS/2, a= nd > > > > > the USB keyboard/mouse don't work with ACPI off. > > > > > > > > > > the acpi dumps are available from: > > > > > ftp://ftp.cs.huji.ac.il/users/danny/freebsd/gx280 > > > > > > > > > > this is the panic: > > > > > > > > > > > > > > > KDB: debugger backends: ddb > > > > > KDB: current backend: ddb > > > > > Copyright (c) 1992-2004 The FreeBSD Project. > > > > > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 199= 3, > > > > > 1994 The Regents of the University of California. All rights > > > > > reserved. FreeBSD 5.3-BETA5 #14: Tue Sep 21 13:44:32 IDT 2004 > > > > > danny@new-dev:/r+d/obj/new-dev/r+d/5.3/src/sys/HUJI > > > > > Timecounter "i8254" frequency 1193182 Hz quality 0 > > > > > CPU: Intel(R) Pentium(R) 4 CPU 3.00GHz (2992.52-MHz 686-class CPU) > > > > > Origin =3D "GenuineIntel" Id =3D 0xf34 Stepping =3D 4 > > > > > > > > > > Features=3D0xbfebfbff > > > >R,PG E,MC A, > > > > > CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE> > > > > > Hyperthreading: 2 logical CPUs > > > > > real memory =3D 1063813120 (1014 MB) > > > > > avail memory =3D 1031565312 (983 MB) > > > > > kernel trap 12 with interrupts disabled > > > > > > > > > > > > > > > Fatal trap 12: page fault while in kernel mode > > > > > cpuid =3D 0; apic id =3D 00 > > > > > fault virtual address =3D 0x1c > > > > > fault code =3D supervisor write, page not present > > > > > instruction pointer =3D 0x8:0xc075dab5 > > > > > stack pointer =3D 0x10:0xc0c21be0 > > > > > frame pointer =3D 0x10:0xc0c21cac > > > > > code segment =3D base 0x0, limit 0xfffff, type 0x1b > > > > > =3D DPL 0, pres 1, def32 1, gran 1 > > > > > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > > > > > current process =3D 0 () > > > > > [thread 0] > > > > > Stopped at vm_fault+0x1b1: lock cmpxchgl %ecx,0x1c(%edx) > > > > > db> trace > > > > > vm_fault(c103a000,c1004000,1,0,c08e36c0) at vm_fault+0x1b1 > > > > > trap_pfault(c0c21d14,0,c1004c29) at trap_pfault+0x184 > > > > > trap(fffd0018,c1000010,c0c20010,c1004bfd,7) at trap+0x2f1 > > > > > calltrap() at calltrap+0x5 > > > > > --- trap 0xc, eip =3D 0xc0a18574, esp =3D 0xc0c21d54, ebp =3D 0xc= 0c21d74 > > > > > --- madt_probe(c22264f0,c08bb1f0,c0c21d98,c05e8302,0) at > > > > > madt_probe+0x174 apic_init(0,c1ec00,c1e000,0,c0441225) at > > > > > apic_init+0x47 > > > > > mi_startup() at mi_startup+0x96 > > > > > begin() at begin+0x2c > > > > > > > > Can you do a 'gdb kernel.debug' and then do 'l madt_probe+0x174' and > > > > e-mail the results? > > > > > > I think i'm doing something wrong :-), tip -38400 com1 works fine, > > > Type '?' for a list of commands, 'help' for more detailed help. > > > OK boot -d > > > /boot/kernel/acpi.ko text=3D0x3fa30 data=3D0x1be4+0x110c > > > syms=3D[0x4+0x72a0+0x4+0x9743] > > > GDB: debug ports: sio > > > GDB: current port: sio > > > KDB: debugger backends: ddb gdb > > > KDB: current backend: ddb > > > KDB: enter: Boot flags requested debugger > > > [thread 0] > > > Stopped at kdb_enter+0x2b: nop > > > db> gdb > > > Step to enter the remote GDB backend. > > > > > > backing out of tip via ~. > > > > > > > > > shuttle-2# gdb -b 38400 kernel.debug > > > GNU gdb 6.1.1 [FreeBSD] > > > Copyright 2004 Free Software Foundation, Inc. > > > GDB is free software, covered by the GNU General Public License, and > > > you are welcome to change it and/or distribute copies of it under > > > certain conditions. Type "show copying" to see the conditions. > > > There is absolutely no warranty for GDB. Type "show warranty" for > > > details. This GDB was configured as "i386-marcel-freebsd"... > > > Ready to go. Enter 'tr' to connect to the remote target > > > with /dev/cuaa0, 'tr /dev/cuaa1' to connect to a different port > > > or 'trf portno' to connect to the remote target with the firewire > > > interface. portno defaults to 5556. > > > > > > Type 'getsyms' after connection to load kld symbols. > > > > > > If you're debugging a local system, you can use 'kldsyms' instead > > > to load the kld symbols. That's a less obnoxious interface. > > > (gdb) tr /dev/cuaa0 > > > Ignoring packet error, continuing... > > > Ignoring packet error, continuing... > > > Ignoring packet error, continuing... > > > Couldn't establish connection to remote target > > > Malformed response to offset query, timeout > > > (gdb) > > > > You don't have to do the gdb during the panic. You just need access to > > the kernel.debug corresponding to the kernel you are booting. Is this a > > custom kernel on the box or are you doing an install? If you are doing > > an install, try disabling apic support by entering 'set > > hint.apic.0.disabled=3D1' at the loader prompt and install that way. T= hen, > > once the box is running, build a debug kernel, reproduce the panic, get > > the instruction pointer address, and then fire up gdb on the kernel.deb= ug > > file and do 'l *'. > > to get gdb talking i had to: > db> gdb > db> step > > Fatal trap 12: page fault while in kernel mode > cpuid =3D 0; apic id =3D 00 > fault virtual address =3D 0x1c > fault code =3D supervisor write, page not present > instruction pointer =3D 0x8:0xc07673b1 > stack pointer =3D 0x10:0xc0c21be0 > frame pointer =3D 0x10:0xc0c21cac > code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, def32 1, gran 1 > processor eflags =3D trace trap, interrupt enabled, resume, IOPL = =3D 0 > current process =3D 0 () > $T0b8:b17376c0;thread:0;#ad~ > ^ > > |--- i typed to get out of db > > then > (not clear from docs, maybe common sense, but you better be in boot/kerne= l) > gdb kernel.debug > > (gdb) l madt_probe+0x174 > Junk at end of line specification. Have to put a * here, i.e. 'l *madt_probe+0x174' > (gdb) bt > #0 vm_fault (map=3D0xc103a000, vaddr=3D0xc1004000, fault_type=3D0x1, > fault_flags=3D0x0) at atomic.h:154 > During symbol reading, Incomplete CFI data; unspecified registers at > 0xc07673d5. > #1 0xc07ce128 in trap_pfault (frame=3D0xc0c21d14, usermode=3D0x0, > eva=3D0xc1004c29) at /r+d/5.3/src/sys/i386/i3 > 86/trap.c:716 > #2 0xc07cdd91 in trap (frame=3D > {tf_fs =3D 0xfffd0018, tf_es =3D 0xc1000010, tf_ds =3D 0xc0c20010, = tf_edi =3D > 0xc1004bfd, tf_esi =3D 0x7, tf_e > bp =3D 0xc0c21d74, tf_isp =3D 0xc0c21d40, tf_ebx =3D 0x2, tf_edx =3D 0x12= , tf_ecx =3D > 0x4, tf_eax =3D 0x0, tf_trapno =3D > 0xc, tf_err =3D 0x0, tf_eip =3D 0xc0a24574, tf_cs =3D 0x8, tf_eflags =3D= 0x90093, > tf_esp =3D 0xc00fec00, tf_ss =3D 0x > 1}) > at /r+d/5.3/src/sys/i386/i386/trap.c:417 > #3 0xc07bc7aa in calltrap () at /r+d/5.3/src/sys/i386/i386/exception.s:1= 40 > #4 0xfffd0018 in ?? () > #5 0xc1000010 in ?? () > #6 0xc0c20010 in ?? () > #7 0xc1004bfd in ?? () > #8 0x00000007 in ?? () > #9 0xc0c21d74 in ?? () > #10 0xc0c21d40 in ?? () > #11 0x00000002 in ?? () > #12 0x00000012 in ?? () > #13 0x00000004 in ?? () > #14 0x00000000 in ?? () > #15 0x0000000c in ?? () > #16 0x00000000 in ?? () > #17 0xc0a24574 in madt_probe () at > /r+d/5.3/src/sys/modules/acpi/acpi/../../../ i386/acpica/madt.c:258 > #18 0xc07c2757 in apic_init (dummy=3D0x0) at > /r+d/5.3/src/sys/i386/i386/local_api c.c:564 > #19 0xc05f1bfe in mi_startup () at /r+d/5.3/src/sys/kern/init_main.c:210 > #20 0xc0441225 in begin () at /r+d/5.3/src/sys/i386/i386/locore.s:348 > (gdb) frame 17 > #17 0xc0a24574 in madt_probe () at > /r+d/5.3/src/sys/modules/acpi/acpi/../../../ i386/acpica/madt.c:258 > 258 for (i =3D 0; i < count; i++) > (gdb) l > 253 printf("MADT: Failed to map > RSDT\n"); 254 return (ENXIO); > 255 } > 256 count =3D (rsdt->Length - sizeof(ACPI_TABLE_HEADE= R)) > / 257 sizeof(UINT32); > 258 for (i =3D 0; i < count; i++) > 259 if (madt_probe_table(rsdt-> > TableOffsetEntry[i])) > 260 break; > 261 madt_unmap_table(rsdt); > 262 } > > the suspicious part: > > (gdb) p *rsdp > $5 =3D { > Signature =3D "RSD PTR ", > Checksum =3D 0xa9, > OemId =3D "DELL ", > Revision =3D 0x0, > RsdtPhysicalAddress =3D 0xfcbfd, > Length =3D 0xffffffff, > XsdtPhysicalAddress =3D 0xffffffffffffffff, > ExtendedChecksum =3D 0xff, > Reserved =3D "=FF=FF=FF" > } > (gdb) p rsdt->Length > Cannot access memory at address 0xc1004c01 > (gdb) p rsdp->RsdtPhysicalAddress > $6 =3D 0xfcbfd > > > rsdp seems to point to valid data, p->RsdtPhysicalAddress also, but > rsdt->Length gives an gdb error, and in any case seems wrong (0xffffffff). > > so i hope all this helps someone, > > danny > PS: i think i should change the subject to: 'debugging on the Bleeding > Edge' Ok, this is helpful. How about first installing the box using safe mode=20 because this will be a lot easier to debug if you can build custom kernels.= =20 Next, add some printf's to dump out rdst->Length in the madt_probe()=20 function. Then boot that kernel over the serial console and mail the outpu= t=20 of your printf. =2D-=20 John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 19:01: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 E805516A4D1 for ; Mon, 27 Sep 2004 19:01:36 +0000 (GMT) Received: from beck.quonix.net (beck.quonix.net [146.145.66.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55D9143D49 for ; Mon, 27 Sep 2004 19:01:36 +0000 (GMT) (envelope-from john@essenz.com) Received: from [192.168.1.100] (pool-141-158-247-68.phil.east.verizon.net [141.158.247.68]) by beck.quonix.net (8.12.11/8.12.11) with ESMTP id i8RJ1XNs093349 for ; Mon, 27 Sep 2004 15:01:33 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-Id: <6ACEE66C-10B6-11D9-A5BE-0003933DDCFA@essenz.com> Content-Type: text/plain; charset=US-ASCII; format=flowed To: freebsd-hackers@freebsd.org From: John Von Essen Date: Mon, 27 Sep 2004 14:52:44 -0400 X-Mailer: Apple Mail (2.619) X-SpamAssassin-2.64-Score: 0.5/6 RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL X-MimeDefang-2.44: beck.quonix.net X-Scanned-By: MIMEDefang 2.44 Subject: hacking SCO.... 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, 27 Sep 2004 19:01:37 -0000 Unfortunately, I have inherited a Intel P200 with SCO OpenServer 5.0.4 with a 4Gb SCSI drive. I have to get the machine back up and running. Here is my dilemma and progress: I have a cpio archive on DDS-2 tape that is valid. I have been able to extract files onto a test disk with FreeBSD. The current 4Gb SCSI disk has a hardware problem. Not sure of where, but roughly 120Mb into the desk it starts making noise of fails. I have a new replacement 4Gb disk. With a FreeBSD boot CD I did a dd and was able to get the new disk setup with all of the old disks partition maps, boot data, etc.,. The new disk actually boots into SCO but fails because it only has 100Mb or so of data. The problem is I do not have any SCI media. According to docs, if I had a boot floppy or emergency repair disk, I could boot with that, then mount the partition and cpio extract the data. I tried doing this with a freebsd boot cd, but could mount the SCO filesystem. In fdisk, it comes up as type 99, and I know the SCO is htfs. Does freebsd support any of this? Any ideas on how I should go about this. All I need to do is get that data from the tape onto the disk and I should good to go. SCO is of no help, they cant provide replacement boot floppy, only sell me complete distribution version 5.0.7 for $100. Thanks john From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 20:13: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 D618B16A4CE for ; Mon, 27 Sep 2004 20:13:18 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 52AC643D48 for ; Mon, 27 Sep 2004 20:13:18 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i8RKFdKt049883; Mon, 27 Sep 2004 14:15:39 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i8RKFc6h049880; Mon, 27 Sep 2004 14:15:39 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Mon, 27 Sep 2004 14:15:38 -0600 (MDT) From: Doug Russell To: John Von Essen In-Reply-To: <6ACEE66C-10B6-11D9-A5BE-0003933DDCFA@essenz.com> Message-ID: <20040927141316.L49857-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: hacking SCO.... 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, 27 Sep 2004 20:13:19 -0000 On Mon, 27 Sep 2004, John Von Essen wrote: > I have a new replacement 4Gb disk. With a FreeBSD boot CD I did a dd > and was able to get the new disk setup with all of the old disks > partition maps, boot data, etc.,. The new disk actually boots into SCO > but fails because it only has 100Mb or so of data. Try adding conv=sync,noerror to your dd line. If most of the data after the defect(s) can be read, you'll end up with an almost complete partition which will likely run. You can then fsck and restore from tape. for example, dd if=/dev/daX of=/dev/daY conv=sync,noerror bs=128k Later...... From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 20:22: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 58D1E16A4CE for ; Mon, 27 Sep 2004 20:22:35 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B2F543D39 for ; Mon, 27 Sep 2004 20:22:35 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i8RKP9Kt049967; Mon, 27 Sep 2004 14:25:09 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i8RKP9RZ049964; Mon, 27 Sep 2004 14:25:09 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Mon, 27 Sep 2004 14:25:09 -0600 (MDT) From: Doug Russell To: John Von Essen In-Reply-To: <20040927141316.L49857-100000@mxb.saturn-tech.com> Message-ID: <20040927142120.K49857-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: hacking SCO.... 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, 27 Sep 2004 20:22:35 -0000 Oh, I love replying to my own posts.... :) On Mon, 27 Sep 2004, Doug Russell wrote: > Try adding conv=sync,noerror to your dd line. If most of the data > after the defect(s) can be read, you'll end up with an almost complete > partition which will likely run. You can then fsck and restore from tape. > > for example, > > dd if=/dev/daX of=/dev/daY conv=sync,noerror bs=128k Actually, remove the bs=128k from above (force of habit). When you're trying to recover a disk like this, you want the block size to be single sectors (bs=512, the default) so you get every sector that is readable. It's slower, but it'll get you a more complete copy if it only skips 1 sector on an error instead of 256. :) If you know the defects are only in a certain range, you can get creative with the skip directives to dd and copy most of the disk in larger blocks, and go back and do the bad part one sector at a time (very handy when recovering today's large IDE disks). See the dd(1) manpage for more info. Later...... From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 22:42: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 9981616A4CE for ; Mon, 27 Sep 2004 22:42:19 +0000 (GMT) Received: from beck.quonix.net (beck.quonix.net [146.145.66.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D76943D3F for ; Mon, 27 Sep 2004 22:42:19 +0000 (GMT) (envelope-from john@essenz.com) Received: from [192.168.1.100] (pool-141-158-247-68.phil.east.verizon.net [141.158.247.68]) by beck.quonix.net (8.12.11/8.12.11) with ESMTP id i8RMgERD096639 for ; Mon, 27 Sep 2004 18:42:14 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <20040927141316.L49857-100000@mxb.saturn-tech.com> References: <20040927141316.L49857-100000@mxb.saturn-tech.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <3FB8020D-10D5-11D9-A5BE-0003933DDCFA@essenz.com> Content-Transfer-Encoding: 7bit From: John Von Essen Date: Mon, 27 Sep 2004 18:33:26 -0400 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.619) X-SpamAssassin-2.64-Score: 0.5/6 RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL X-MimeDefang-2.44: beck.quonix.net X-Scanned-By: MIMEDefang 2.44 Subject: Re: hacking SCO.... 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, 27 Sep 2004 22:42:19 -0000 Well, I was able to get a boot/install floppy made. Then install a fresh SCO. Then create recovery floppies, then boot with recovery floppy and try to cpio tape data to /mnt. However, in both the recover floppy and the real SCO system I have to configure the tape drive apparently. As of right now, I can not access the tape device. SCO's tape device builder asks what type of tape, is a DDS-2 considered DAT or 8mm? Anyway, I wish I would of thought of the dd args to skip the bad sectors and continue on. Now that SCO is installed (which took an hour and a half) I would hate to start over. The drive is really messed up, dd would copy a couple thousand records, then the drive would start making a horrendous noise and through an IO error stopping dd. You have no idea how much I hate SCO. I feel like I am cheating on my girlfriend every time I login to this damn box. -john On Sep 27, 2004, at 4:15 PM, Doug Russell wrote: > > On Mon, 27 Sep 2004, John Von Essen wrote: > >> I have a new replacement 4Gb disk. With a FreeBSD boot CD I did a dd >> and was able to get the new disk setup with all of the old disks >> partition maps, boot data, etc.,. The new disk actually boots into SCO >> but fails because it only has 100Mb or so of data. > > Try adding conv=sync,noerror to your dd line. If most of the > data > after the defect(s) can be read, you'll end up with an almost complete > partition which will likely run. You can then fsck and restore from > tape. > > for example, > > dd if=/dev/daX of=/dev/daY conv=sync,noerror bs=128k > > Later...... > > From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 23:22: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 4EF8816A4CE for ; Mon, 27 Sep 2004 23:22:14 +0000 (GMT) Received: from skippyii.compar.com (old.compar.com [216.208.38.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B50343D1D for ; Mon, 27 Sep 2004 23:22:12 +0000 (GMT) (envelope-from matt@gsicomp.on.ca) Received: from hermes (CPE00062566c7bb-CM000039c69a66.cpe.net.cable.rogers.com [69.193.82.185])i8RNRngw000150; Mon, 27 Sep 2004 19:27:54 -0400 (EDT) (envelope-from matt@gsicomp.on.ca) Message-ID: <002901c4a4e8$65503620$1200a8c0@gsicomp.on.ca> From: "Matt Emmerton" To: "John Von Essen" , References: <20040927141316.L49857-100000@mxb.saturn-tech.com> <3FB8020D-10D5-11D9-A5BE-0003933DDCFA@essenz.com> Date: Mon, 27 Sep 2004 19:19:01 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Subject: Re: hacking SCO.... 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, 27 Sep 2004 23:22:14 -0000 I believe DAT is what you want to tell SCO. -- Matt ----- Original Message ----- From: "John Von Essen" To: Sent: Monday, September 27, 2004 6:33 PM Subject: Re: hacking SCO.... > Well, > > I was able to get a boot/install floppy made. Then install a fresh SCO. > Then create recovery floppies, then boot with recovery floppy and try > to cpio tape data to /mnt. > > However, in both the recover floppy and the real SCO system I have to > configure the tape drive apparently. As of right now, I can not access > the tape device. > > SCO's tape device builder asks what type of tape, is a DDS-2 considered > DAT or 8mm? > > Anyway, I wish I would of thought of the dd args to skip the bad > sectors and continue on. Now that SCO is installed (which took an hour > and a half) I would hate to start over. The drive is really messed up, > dd would copy a couple thousand records, then the drive would start > making a horrendous noise and through an IO error stopping dd. > > You have no idea how much I hate SCO. I feel like I am cheating on my > girlfriend every time I login to this damn box. > > -john > > > On Sep 27, 2004, at 4:15 PM, Doug Russell wrote: > > > > > On Mon, 27 Sep 2004, John Von Essen wrote: > > > >> I have a new replacement 4Gb disk. With a FreeBSD boot CD I did a dd > >> and was able to get the new disk setup with all of the old disks > >> partition maps, boot data, etc.,. The new disk actually boots into SCO > >> but fails because it only has 100Mb or so of data. > > > > Try adding conv=sync,noerror to your dd line. If most of the > > data > > after the defect(s) can be read, you'll end up with an almost complete > > partition which will likely run. You can then fsck and restore from > > tape. > > > > for example, > > > > dd if=/dev/daX of=/dev/daY conv=sync,noerror bs=128k > > > > Later...... > > > > > > _______________________________________________ > 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 Tue Sep 28 01:52: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 E70A716A4CE for ; Tue, 28 Sep 2004 01:52:18 +0000 (GMT) Received: from blackwater.lemis.com (wantadilla.lemis.com [192.109.197.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8589543D1F for ; Tue, 28 Sep 2004 01:52:16 +0000 (GMT) (envelope-from grog@lemis.com) Received: by blackwater.lemis.com (Postfix, from userid 1004) id 96B1885654; Tue, 28 Sep 2004 11:22:12 +0930 (CST) Date: Tue, 28 Sep 2004 11:22:12 +0930 From: Greg 'groggy' Lehey To: Jerry Toung Message-ID: <20040928015212.GN12394@wantadilla.lemis.com> References: <200409241628.43022.jtoung@earthlink.net> <200409241648.10308.jtoung@earthlink.net> <4154B97B.7050902@teel.ws> <200409271107.21241.jtoung@arc.nasa.gov> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qySB1iFW++5nzUxH" Content-Disposition: inline In-Reply-To: <200409271107.21241.jtoung@arc.nasa.gov> User-Agent: Mutt/1.4.2.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: Mark Teel cc: freebsd-hackers@freebsd.org Subject: Re: remote debugging question 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, 28 Sep 2004 01:52:19 -0000 --qySB1iFW++5nzUxH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Monday, 27 September 2004 at 11:07:21 -0700, Jerry Toung wrote: > Good morning list, > I CAN connect to the target but the 'bt" command return #0 0x00000000 in ?? > () at the remote. That suggests that you're not connected. > So this is what I am doing, hopefully somebody can tell me what I am > missing. I have 2 laptops same brand and model, both running > 6.0current and same kernel config. > > laptop A panics because of kld I am writing and I want to debug A with laptop > B. > > I reboot A and login and enter CTRL-ATL-ESC to get db> prompt, then enter > 'gdb', then enter 's'. At this point I don't get the db> prompt anymore and A > seems to be in a loop, is that normal? Yes. It's not in a loop, it's waiting for remote gdb. > on laptop B, the only thing I did is get the copy of kernel.debug.A > in /usr/obj/usr/src/sys/MYKERNEL You'll need the sources as well, but that's the next problem, not the one you're experiencing. > I 'cd' to that location an run > kgdb > file kernel.debug.A > set remotebaud 1 That's obviously wrong. This is the bit rate of the serial connection. I don't know what gdb does with such a speed (0.1 bytes per second), but it looks like it ignores it. > set remotebreak 1 > set debug remote 1 > target remote /dev/cuaa0 > > it connects, on B screen (not using X) I see > > Warning: Unable to find dynamic linker breakpoint function. > GDB will be unable to debug shared library initializers > and track explicitly loaded dynamic code. > warning: shared library handler failed to enable breakpoint > Sending packet: $qSymbol ::#5...Ack > Packet Received: > Packet qSymbol (symbol-lookup) is NOT supported This looks like a communication problem. Typically the connection should run at 9600 bps (well, it should run as fast as it can, but we've had problems above that speed). gdb has been significantly changed in the last few months, and it's possible that I'm out of date with some details. It's also possible that this is a bug that crept in there, but I'd first check the bit rates. My personal favourite for remote debugging is firewire. If you have the hardware, you should use it. I'm working on documentation, but there's a fair amount in gdb(4). The format of the fwcontrol and dconschat EUI64s has changed, and the man page needs changing as a result (doc committers please note). It should be obvious, though. > when I type 'bt', that's where I get > #0 0x00000000 in ?? () Yes, that's what I thought. > Please somebody advise since I can't do anything with that. And > laptop A is still hanging/loop, and no prompt. If you can't get the connection to work with the correct bit rate, you'll have to reset and reboot it. Greg -- See complete headers for address and phone numbers. --qySB1iFW++5nzUxH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBWMPMIubykFB6QiMRAp7jAJ9EN8UpXC/b8fConKhCDH3jMRp9cwCfbp36 4C0+XcXrEUwkoxPgHlA5eMQ= =sELg -----END PGP SIGNATURE----- --qySB1iFW++5nzUxH-- From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 10:08: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 B704A16A4CE; Tue, 28 Sep 2004 10:08:47 +0000 (GMT) Received: from mail0.jaist.ac.jp (mail0.jaist.ac.jp [150.65.5.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1C3C43D45; Tue, 28 Sep 2004 10:08:41 +0000 (GMT) (envelope-from zrelli@jaist.ac.jp) Received: from mail-vc.jaist.ac.jp (mail-vc.jaist.ac.jp [150.65.5.31]) by mail0.jaist.ac.jp (3.7W-jaist_mail) with ESMTP id i8SA8bN03722; Tue, 28 Sep 2004 19:08:37 +0900 (JST) Received: from mail-vc.jaist.ac.jp (localhost [127.0.0.1]) by localhost.jaist.ac.jp (Postfix) with ESMTP id F3878848C; Tue, 28 Sep 2004 19:08:36 +0900 (JST) Received: from smtp.jaist.ac.jp (smtp.jaist.ac.jp [150.65.38.97]) by mail-vc.jaist.ac.jp (Postfix) with ESMTP id D2E6F8489; Tue, 28 Sep 2004 19:08:36 +0900 (JST) Received: from jaist.ac.jp (is32e1b21.jaist.ac.jp [150.65.118.21]) by smtp.jaist.ac.jp (3.7W-smtp) with ESMTP id i8SA70h02621; Tue, 28 Sep 2004 19:07:00 +0900 (JST) Message-ID: <41593824.9030006@jaist.ac.jp> Date: Tue, 28 Sep 2004 19:08:36 +0900 From: Zrelli Saber Ben Mohamed User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020921 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org, hackers@freebsd.org, net@freebsd.org Content-Type: multipart/mixed; boundary="------------080104040208090602080700" Subject: divert , ipfw question 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, 28 Sep 2004 10:08:47 -0000 This is a multi-part message in MIME format. --------------080104040208090602080700 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi , I'm interesed in the "divert" mechanism and want to try it out , so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding the IPDIVERT option and then added the needed lines in the rc.conf file, after that , I set up ipfw to divert packets to some port here is my ipfw rule set . 00100 allow ip from any to any via lo0 00200 deny ip from any to 127.0.0.0/8 00300 deny ip from 127.0.0.0/8 to any 65000 allow ip from any to any 65100 divert 5000 ip from any 22 to me <---- the divert rule 65535 deny ip from any to any then, I wanted to monitor the diverted traffic using tcpdump : $ tcpdump port 5000 when I do a telnet connection to the port 22 from a remote host , I was expecting that tcpdump will display packets diverted to the port 5000 by ipfw. The remote host I use shows that it connects to port 22 and the ipfw divert rule seems not to work. I can set another rule to block the traffic in the port 22 , and it works. only the divert rule seems to fail. I wrote some piece of code using divert socket to read packets from the divert port , but no result ... I think I'm missing something , so please enlighten my mind ... Many Thanks -- Saber --------------080104040208090602080700 Content-Type: text/plain; name="divertd.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="divertd.c" /*#include #include #include #include #include #include #include */ #include /* NB: we rely on this for */ #include #include #include #include #include #include #include #include #include #include #ifdef IPSEC #include #endif /*IPSEC*/ #include #include #include #include #include #include #include #include #include #include #include #include #define BUFSIZE 65535 int main(int argc, char **argv) { int fd, rawfd, fdfw, ret, n; int on = 1; struct sockaddr_in bindPort, sin; int sinlen; int port_nb; struct ip *hdr; unsigned char packet[BUFSIZE]; struct in_addr addr; int i, direction; struct ip_mreq mreq; if (argc != 2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } bindPort.sin_family = AF_INET; bindPort.sin_port = htons(atol(argv[1])); bindPort.sin_addr.s_addr = 0; fprintf(stderr, "%s:Creating a socket\n", argv[0]); /* open a divert socket */ fd = socket(AF_INET, SOCK_RAW, IPPROTO_DIVERT); if (fd == -1) { fprintf(stderr, "%s:We could not open a divert socket\n", argv[0]); exit(1); } bindPort.sin_family = AF_INET; bindPort.sin_port = htons(atol(argv[1])); bindPort.sin_addr.s_addr = 0; fprintf(stderr, "%s:Binding a socket\n", argv[0]); ret = bind(fd, (struct sockaddr*)&bindPort, sizeof(struct sockaddr_in)); if (ret != 0) { close(fd); fprintf(stderr, "%s: Error bind(): %s", argv[0], strerror(ret)); exit(2); } printf("%s: Waiting for data...\n", argv[0]); /* read data in */ sinlen = sizeof(struct sockaddr_in); while (1) { n = recvfrom(fd, packet, BUFSIZE, 0, (struct sockaddr*)&sin, &sinlen); hdr = (struct ip *) packet; printf("%s: The packet looks like this:\n", argv[0]); for (i = 0; i < 40; i++) { printf("%02x ", (int)*(packet + i)); if (!((i + 1) % 16)) printf("\n"); }; printf("\n"); printf("%s: Source address: %s\n", argv[0], inet_ntoa(hdr->ip_src)); printf("%s: Destination address: %s\n", argv[0], inet_ntoa(hdr->ip_dst)); printf("%s: Receiving IF address: %s\n", argv[0], inet_ntoa(sin.sin_addr)); printf("%s: Protocol number: %i\n", argv[0], hdr->ip_p); } } --------------080104040208090602080700-- From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 10:08: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 B704A16A4CE; Tue, 28 Sep 2004 10:08:47 +0000 (GMT) Received: from mail0.jaist.ac.jp (mail0.jaist.ac.jp [150.65.5.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id D1C3C43D45; Tue, 28 Sep 2004 10:08:41 +0000 (GMT) (envelope-from zrelli@jaist.ac.jp) Received: from mail-vc.jaist.ac.jp (mail-vc.jaist.ac.jp [150.65.5.31]) by mail0.jaist.ac.jp (3.7W-jaist_mail) with ESMTP id i8SA8bN03722; Tue, 28 Sep 2004 19:08:37 +0900 (JST) Received: from mail-vc.jaist.ac.jp (localhost [127.0.0.1]) by localhost.jaist.ac.jp (Postfix) with ESMTP id F3878848C; Tue, 28 Sep 2004 19:08:36 +0900 (JST) Received: from smtp.jaist.ac.jp (smtp.jaist.ac.jp [150.65.38.97]) by mail-vc.jaist.ac.jp (Postfix) with ESMTP id D2E6F8489; Tue, 28 Sep 2004 19:08:36 +0900 (JST) Received: from jaist.ac.jp (is32e1b21.jaist.ac.jp [150.65.118.21]) by smtp.jaist.ac.jp (3.7W-smtp) with ESMTP id i8SA70h02621; Tue, 28 Sep 2004 19:07:00 +0900 (JST) Message-ID: <41593824.9030006@jaist.ac.jp> Date: Tue, 28 Sep 2004 19:08:36 +0900 From: Zrelli Saber Ben Mohamed User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020921 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org, hackers@freebsd.org, net@freebsd.org Content-Type: multipart/mixed; boundary="------------080104040208090602080700" Subject: divert , ipfw question 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, 28 Sep 2004 10:08:48 -0000 This is a multi-part message in MIME format. --------------080104040208090602080700 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi , I'm interesed in the "divert" mechanism and want to try it out , so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding the IPDIVERT option and then added the needed lines in the rc.conf file, after that , I set up ipfw to divert packets to some port here is my ipfw rule set . 00100 allow ip from any to any via lo0 00200 deny ip from any to 127.0.0.0/8 00300 deny ip from 127.0.0.0/8 to any 65000 allow ip from any to any 65100 divert 5000 ip from any 22 to me <---- the divert rule 65535 deny ip from any to any then, I wanted to monitor the diverted traffic using tcpdump : $ tcpdump port 5000 when I do a telnet connection to the port 22 from a remote host , I was expecting that tcpdump will display packets diverted to the port 5000 by ipfw. The remote host I use shows that it connects to port 22 and the ipfw divert rule seems not to work. I can set another rule to block the traffic in the port 22 , and it works. only the divert rule seems to fail. I wrote some piece of code using divert socket to read packets from the divert port , but no result ... I think I'm missing something , so please enlighten my mind ... Many Thanks -- Saber --------------080104040208090602080700 Content-Type: text/plain; name="divertd.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="divertd.c" /*#include #include #include #include #include #include #include */ #include /* NB: we rely on this for */ #include #include #include #include #include #include #include #include #include #include #ifdef IPSEC #include #endif /*IPSEC*/ #include #include #include #include #include #include #include #include #include #include #include #include #define BUFSIZE 65535 int main(int argc, char **argv) { int fd, rawfd, fdfw, ret, n; int on = 1; struct sockaddr_in bindPort, sin; int sinlen; int port_nb; struct ip *hdr; unsigned char packet[BUFSIZE]; struct in_addr addr; int i, direction; struct ip_mreq mreq; if (argc != 2) { fprintf(stderr, "Usage: %s \n", argv[0]); exit(1); } bindPort.sin_family = AF_INET; bindPort.sin_port = htons(atol(argv[1])); bindPort.sin_addr.s_addr = 0; fprintf(stderr, "%s:Creating a socket\n", argv[0]); /* open a divert socket */ fd = socket(AF_INET, SOCK_RAW, IPPROTO_DIVERT); if (fd == -1) { fprintf(stderr, "%s:We could not open a divert socket\n", argv[0]); exit(1); } bindPort.sin_family = AF_INET; bindPort.sin_port = htons(atol(argv[1])); bindPort.sin_addr.s_addr = 0; fprintf(stderr, "%s:Binding a socket\n", argv[0]); ret = bind(fd, (struct sockaddr*)&bindPort, sizeof(struct sockaddr_in)); if (ret != 0) { close(fd); fprintf(stderr, "%s: Error bind(): %s", argv[0], strerror(ret)); exit(2); } printf("%s: Waiting for data...\n", argv[0]); /* read data in */ sinlen = sizeof(struct sockaddr_in); while (1) { n = recvfrom(fd, packet, BUFSIZE, 0, (struct sockaddr*)&sin, &sinlen); hdr = (struct ip *) packet; printf("%s: The packet looks like this:\n", argv[0]); for (i = 0; i < 40; i++) { printf("%02x ", (int)*(packet + i)); if (!((i + 1) % 16)) printf("\n"); }; printf("\n"); printf("%s: Source address: %s\n", argv[0], inet_ntoa(hdr->ip_src)); printf("%s: Destination address: %s\n", argv[0], inet_ntoa(hdr->ip_dst)); printf("%s: Receiving IF address: %s\n", argv[0], inet_ntoa(sin.sin_addr)); printf("%s: Protocol number: %i\n", argv[0], hdr->ip_p); } } --------------080104040208090602080700-- From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 10:38: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 3201216A4CE; Tue, 28 Sep 2004 10:38:19 +0000 (GMT) Received: from ylpvm15.prodigy.net (ylpvm15-ext.prodigy.net [207.115.57.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id D937643D39; Tue, 28 Sep 2004 10:38:18 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-67-124-49-205.dsl.snfc21.pacbell.net [67.124.49.205])i8SAcMqM024628; Tue, 28 Sep 2004 06:38:22 -0400 Message-ID: <41593F14.8050603@elischer.org> Date: Tue, 28 Sep 2004 03:38:12 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: Zrelli Saber Ben Mohamed References: <41593824.9030006@jaist.ac.jp> In-Reply-To: <41593824.9030006@jaist.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org cc: hackers@freebsd.org cc: net@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: divert , ipfw question 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, 28 Sep 2004 10:38:19 -0000 Zrelli Saber Ben Mohamed wrote: > Hi , > > I'm interesed in the "divert" mechanism and want to try it out , > so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding the > IPDIVERT option and then added the needed lines in the rc.conf file, > after that , I set up ipfw to divert packets to some port > here is my ipfw rule set . > > 00100 allow ip from any to any via lo0 > 00200 deny ip from any to 127.0.0.0/8 > 00300 deny ip from 127.0.0.0/8 to any > 65000 allow ip from any to any > 65100 divert 5000 ip from any 22 to me <---- the divert rule > 65535 deny ip from any to any > > then, I wanted to monitor the diverted traffic using tcpdump : > > $ tcpdump port 5000 > > when I do a telnet connection to the port 22 from a remote host , I was > expecting that tcpdump will display packets diverted to the port 5000 by > ipfw. > The remote host I use shows that it connects to port 22 and the ipfw > divert rule seems not to work. > I can set another rule to block the traffic in the port 22 , and it works. > only the divert rule seems to fail. > > I wrote some piece of code using divert socket to read packets from the > divert port , but no result ... > > I think I'm missing something , > > so please enlighten my mind ... you have 2 problems.. firstly, all packats never get to your divert rule ecause they are accepted by the previous rule.. 65000 allow ip from any to any secondly "divert" sends teh data to a "DIVERT" socket.. you can also use a 'tee' command in teh ipfw to just get a copy of the packet in which case you will see the negotioation continue. Divert sockets remove the packet from the kernel. Since you do not pass the packet BACK to the kernel again no further negotiation will occur as no tcp handshake will occur. If you use the 'tee' rule you are effectively simulating bpf and libpcap. If you use 'divert' then you need to write the packet (and the sockaddr) back to the divert socket to reinject it to the system after you have examined (and possibly modified) it. > > > Many Thanks > > > -- > Saber > > > > > > > ------------------------------------------------------------------------ > > > /*#include > #include > #include > #include > #include > #include > #include > */ > #include /* NB: we rely on this for */ > #include > #include > #include > #include > > #include > #include > #include > #include > #include > #include > > #ifdef IPSEC > #include > #endif /*IPSEC*/ > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > > #define BUFSIZE 65535 > > > int > main(int argc, char **argv) > { > int fd, rawfd, fdfw, ret, n; > int on = 1; > struct sockaddr_in bindPort, sin; > int sinlen; > int port_nb; > struct ip *hdr; > unsigned char packet[BUFSIZE]; > struct in_addr addr; > int i, direction; > struct ip_mreq mreq; > > if (argc != 2) { > fprintf(stderr, "Usage: %s \n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > > fprintf(stderr, "%s:Creating a socket\n", argv[0]); > /* open a divert socket */ > fd = socket(AF_INET, SOCK_RAW, IPPROTO_DIVERT); > > if (fd == -1) { > fprintf(stderr, "%s:We could not open a divert socket\n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > fprintf(stderr, "%s:Binding a socket\n", argv[0]); > ret = bind(fd, (struct sockaddr*)&bindPort, sizeof(struct sockaddr_in)); > > if (ret != 0) { > close(fd); > fprintf(stderr, "%s: Error bind(): %s", argv[0], strerror(ret)); > exit(2); > } > printf("%s: Waiting for data...\n", argv[0]); > /* read data in */ > sinlen = sizeof(struct sockaddr_in); > while (1) { > n = recvfrom(fd, packet, BUFSIZE, 0, (struct sockaddr*)&sin, &sinlen); > hdr = (struct ip *) packet; > > printf("%s: The packet looks like this:\n", argv[0]); > for (i = 0; i < 40; i++) { > printf("%02x ", (int)*(packet + i)); > if (!((i + 1) % 16)) > printf("\n"); > }; > printf("\n"); > > printf("%s: Source address: %s\n", argv[0], inet_ntoa(hdr->ip_src)); > printf("%s: Destination address: %s\n", argv[0], inet_ntoa(hdr->ip_dst)); > printf("%s: Receiving IF address: %s\n", argv[0], inet_ntoa(sin.sin_addr)); > printf("%s: Protocol number: %i\n", argv[0], hdr->ip_p); > > } > } > > > ------------------------------------------------------------------------ > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 10:38: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 3201216A4CE; Tue, 28 Sep 2004 10:38:19 +0000 (GMT) Received: from ylpvm15.prodigy.net (ylpvm15-ext.prodigy.net [207.115.57.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id D937643D39; Tue, 28 Sep 2004 10:38:18 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-67-124-49-205.dsl.snfc21.pacbell.net [67.124.49.205])i8SAcMqM024628; Tue, 28 Sep 2004 06:38:22 -0400 Message-ID: <41593F14.8050603@elischer.org> Date: Tue, 28 Sep 2004 03:38:12 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: Zrelli Saber Ben Mohamed References: <41593824.9030006@jaist.ac.jp> In-Reply-To: <41593824.9030006@jaist.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org cc: hackers@freebsd.org cc: net@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: divert , ipfw question 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, 28 Sep 2004 10:38:19 -0000 Zrelli Saber Ben Mohamed wrote: > Hi , > > I'm interesed in the "divert" mechanism and want to try it out , > so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding the > IPDIVERT option and then added the needed lines in the rc.conf file, > after that , I set up ipfw to divert packets to some port > here is my ipfw rule set . > > 00100 allow ip from any to any via lo0 > 00200 deny ip from any to 127.0.0.0/8 > 00300 deny ip from 127.0.0.0/8 to any > 65000 allow ip from any to any > 65100 divert 5000 ip from any 22 to me <---- the divert rule > 65535 deny ip from any to any > > then, I wanted to monitor the diverted traffic using tcpdump : > > $ tcpdump port 5000 > > when I do a telnet connection to the port 22 from a remote host , I was > expecting that tcpdump will display packets diverted to the port 5000 by > ipfw. > The remote host I use shows that it connects to port 22 and the ipfw > divert rule seems not to work. > I can set another rule to block the traffic in the port 22 , and it works. > only the divert rule seems to fail. > > I wrote some piece of code using divert socket to read packets from the > divert port , but no result ... > > I think I'm missing something , > > so please enlighten my mind ... you have 2 problems.. firstly, all packats never get to your divert rule ecause they are accepted by the previous rule.. 65000 allow ip from any to any secondly "divert" sends teh data to a "DIVERT" socket.. you can also use a 'tee' command in teh ipfw to just get a copy of the packet in which case you will see the negotioation continue. Divert sockets remove the packet from the kernel. Since you do not pass the packet BACK to the kernel again no further negotiation will occur as no tcp handshake will occur. If you use the 'tee' rule you are effectively simulating bpf and libpcap. If you use 'divert' then you need to write the packet (and the sockaddr) back to the divert socket to reinject it to the system after you have examined (and possibly modified) it. > > > Many Thanks > > > -- > Saber > > > > > > > ------------------------------------------------------------------------ > > > /*#include > #include > #include > #include > #include > #include > #include > */ > #include /* NB: we rely on this for */ > #include > #include > #include > #include > > #include > #include > #include > #include > #include > #include > > #ifdef IPSEC > #include > #endif /*IPSEC*/ > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > > #define BUFSIZE 65535 > > > int > main(int argc, char **argv) > { > int fd, rawfd, fdfw, ret, n; > int on = 1; > struct sockaddr_in bindPort, sin; > int sinlen; > int port_nb; > struct ip *hdr; > unsigned char packet[BUFSIZE]; > struct in_addr addr; > int i, direction; > struct ip_mreq mreq; > > if (argc != 2) { > fprintf(stderr, "Usage: %s \n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > > fprintf(stderr, "%s:Creating a socket\n", argv[0]); > /* open a divert socket */ > fd = socket(AF_INET, SOCK_RAW, IPPROTO_DIVERT); > > if (fd == -1) { > fprintf(stderr, "%s:We could not open a divert socket\n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > fprintf(stderr, "%s:Binding a socket\n", argv[0]); > ret = bind(fd, (struct sockaddr*)&bindPort, sizeof(struct sockaddr_in)); > > if (ret != 0) { > close(fd); > fprintf(stderr, "%s: Error bind(): %s", argv[0], strerror(ret)); > exit(2); > } > printf("%s: Waiting for data...\n", argv[0]); > /* read data in */ > sinlen = sizeof(struct sockaddr_in); > while (1) { > n = recvfrom(fd, packet, BUFSIZE, 0, (struct sockaddr*)&sin, &sinlen); > hdr = (struct ip *) packet; > > printf("%s: The packet looks like this:\n", argv[0]); > for (i = 0; i < 40; i++) { > printf("%02x ", (int)*(packet + i)); > if (!((i + 1) % 16)) > printf("\n"); > }; > printf("\n"); > > printf("%s: Source address: %s\n", argv[0], inet_ntoa(hdr->ip_src)); > printf("%s: Destination address: %s\n", argv[0], inet_ntoa(hdr->ip_dst)); > printf("%s: Receiving IF address: %s\n", argv[0], inet_ntoa(sin.sin_addr)); > printf("%s: Protocol number: %i\n", argv[0], hdr->ip_p); > > } > } > > > ------------------------------------------------------------------------ > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 11:13: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 DCA9416A4CE; Tue, 28 Sep 2004 11:13:36 +0000 (GMT) Received: from mail0.jaist.ac.jp (mail0.jaist.ac.jp [150.65.5.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 049CC43D1F; Tue, 28 Sep 2004 11:13:31 +0000 (GMT) (envelope-from zrelli@jaist.ac.jp) Received: from mail-vc.jaist.ac.jp (mail-vc.jaist.ac.jp [150.65.5.31]) by mail0.jaist.ac.jp (3.7W-jaist_mail) with ESMTP id i8SBDUN22068; Tue, 28 Sep 2004 20:13:30 +0900 (JST) Received: from mail-vc.jaist.ac.jp (localhost [127.0.0.1]) by localhost.jaist.ac.jp (Postfix) with ESMTP id 326DD8489; Tue, 28 Sep 2004 20:13:30 +0900 (JST) Received: from smtp.jaist.ac.jp (smtp.jaist.ac.jp [150.65.38.97]) by mail-vc.jaist.ac.jp (Postfix) with ESMTP id 0C6178484; Tue, 28 Sep 2004 20:13:30 +0900 (JST) Received: from jaist.ac.jp (is32e1b21.jaist.ac.jp [150.65.118.21]) by smtp.jaist.ac.jp (3.7W-smtp) with ESMTP id i8SBBqh04276; Tue, 28 Sep 2004 20:11:52 +0900 (JST) Message-ID: <41594759.5010104@jaist.ac.jp> Date: Tue, 28 Sep 2004 20:13:29 +0900 From: Zrelli Saber Ben Mohamed User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020921 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Zrelli Saber Ben Mohamed References: <41593824.9030006@jaist.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org cc: hackers@freebsd.org cc: net@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: divert , ipfw question 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, 28 Sep 2004 11:13:37 -0000 Thanks ! I got it working. -- Saber Zrelli Saber Ben Mohamed wrote: > Hi , > > I'm interesed in the "divert" mechanism and want to try it out , > so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding > the IPDIVERT option and then added the needed lines in the rc.conf file, > after that , I set up ipfw to divert packets to some port > here is my ipfw rule set . > > 00100 allow ip from any to any via lo0 > 00200 deny ip from any to 127.0.0.0/8 > 00300 deny ip from 127.0.0.0/8 to any > 65000 allow ip from any to any > 65100 divert 5000 ip from any 22 to me <---- the divert rule > 65535 deny ip from any to any > > then, I wanted to monitor the diverted traffic using tcpdump : > > $ tcpdump port 5000 > > when I do a telnet connection to the port 22 from a remote host , I > was expecting that tcpdump will display packets diverted to the port > 5000 by ipfw. > The remote host I use shows that it connects to port 22 and the ipfw > divert rule seems not to work. > I can set another rule to block the traffic in the port 22 , and it > works. > only the divert rule seems to fail. > > I wrote some piece of code using divert socket to read packets from > the divert port , but no result ... > > I think I'm missing something , > > so please enlighten my mind ... > > > Many Thanks > > > -- > Saber > > > > > >------------------------------------------------------------------------ > > >/*#include >#include >#include >#include >#include >#include >#include >*/ >#include /* NB: we rely on this for */ >#include >#include >#include >#include > >#include >#include >#include >#include >#include >#include > >#ifdef IPSEC >#include >#endif /*IPSEC*/ > >#include >#include >#include >#include >#include >#include >#include >#include >#include >#include >#include >#include > > >#define BUFSIZE 65535 > > >int >main(int argc, char **argv) >{ > int fd, rawfd, fdfw, ret, n; > int on = 1; > struct sockaddr_in bindPort, sin; > int sinlen; > int port_nb; > struct ip *hdr; > unsigned char packet[BUFSIZE]; > struct in_addr addr; > int i, direction; > struct ip_mreq mreq; > > if (argc != 2) { > fprintf(stderr, "Usage: %s \n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > > fprintf(stderr, "%s:Creating a socket\n", argv[0]); > /* open a divert socket */ > fd = socket(AF_INET, SOCK_RAW, IPPROTO_DIVERT); > > if (fd == -1) { > fprintf(stderr, "%s:We could not open a divert socket\n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > fprintf(stderr, "%s:Binding a socket\n", argv[0]); > ret = bind(fd, (struct sockaddr*)&bindPort, sizeof(struct sockaddr_in)); > > if (ret != 0) { > close(fd); > fprintf(stderr, "%s: Error bind(): %s", argv[0], strerror(ret)); > exit(2); > } > printf("%s: Waiting for data...\n", argv[0]); > /* read data in */ > sinlen = sizeof(struct sockaddr_in); > while (1) { > n = recvfrom(fd, packet, BUFSIZE, 0, (struct sockaddr*)&sin, &sinlen); > hdr = (struct ip *) packet; > > printf("%s: The packet looks like this:\n", argv[0]); > for (i = 0; i < 40; i++) { > printf("%02x ", (int)*(packet + i)); > if (!((i + 1) % 16)) > printf("\n"); > }; > printf("\n"); > > printf("%s: Source address: %s\n", argv[0], inet_ntoa(hdr->ip_src)); > printf("%s: Destination address: %s\n", argv[0], inet_ntoa(hdr->ip_dst)); > printf("%s: Receiving IF address: %s\n", argv[0], inet_ntoa(sin.sin_addr)); > printf("%s: Protocol number: %i\n", argv[0], hdr->ip_p); > > } >} > > >------------------------------------------------------------------------ > >_______________________________________________ >freebsd-net@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-net >To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 11:13: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 DCA9416A4CE; Tue, 28 Sep 2004 11:13:36 +0000 (GMT) Received: from mail0.jaist.ac.jp (mail0.jaist.ac.jp [150.65.5.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 049CC43D1F; Tue, 28 Sep 2004 11:13:31 +0000 (GMT) (envelope-from zrelli@jaist.ac.jp) Received: from mail-vc.jaist.ac.jp (mail-vc.jaist.ac.jp [150.65.5.31]) by mail0.jaist.ac.jp (3.7W-jaist_mail) with ESMTP id i8SBDUN22068; Tue, 28 Sep 2004 20:13:30 +0900 (JST) Received: from mail-vc.jaist.ac.jp (localhost [127.0.0.1]) by localhost.jaist.ac.jp (Postfix) with ESMTP id 326DD8489; Tue, 28 Sep 2004 20:13:30 +0900 (JST) Received: from smtp.jaist.ac.jp (smtp.jaist.ac.jp [150.65.38.97]) by mail-vc.jaist.ac.jp (Postfix) with ESMTP id 0C6178484; Tue, 28 Sep 2004 20:13:30 +0900 (JST) Received: from jaist.ac.jp (is32e1b21.jaist.ac.jp [150.65.118.21]) by smtp.jaist.ac.jp (3.7W-smtp) with ESMTP id i8SBBqh04276; Tue, 28 Sep 2004 20:11:52 +0900 (JST) Message-ID: <41594759.5010104@jaist.ac.jp> Date: Tue, 28 Sep 2004 20:13:29 +0900 From: Zrelli Saber Ben Mohamed User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020921 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Zrelli Saber Ben Mohamed References: <41593824.9030006@jaist.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-net@freebsd.org cc: hackers@freebsd.org cc: net@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: divert , ipfw question 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, 28 Sep 2004 11:13:37 -0000 Thanks ! I got it working. -- Saber Zrelli Saber Ben Mohamed wrote: > Hi , > > I'm interesed in the "divert" mechanism and want to try it out , > so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding > the IPDIVERT option and then added the needed lines in the rc.conf file, > after that , I set up ipfw to divert packets to some port > here is my ipfw rule set . > > 00100 allow ip from any to any via lo0 > 00200 deny ip from any to 127.0.0.0/8 > 00300 deny ip from 127.0.0.0/8 to any > 65000 allow ip from any to any > 65100 divert 5000 ip from any 22 to me <---- the divert rule > 65535 deny ip from any to any > > then, I wanted to monitor the diverted traffic using tcpdump : > > $ tcpdump port 5000 > > when I do a telnet connection to the port 22 from a remote host , I > was expecting that tcpdump will display packets diverted to the port > 5000 by ipfw. > The remote host I use shows that it connects to port 22 and the ipfw > divert rule seems not to work. > I can set another rule to block the traffic in the port 22 , and it > works. > only the divert rule seems to fail. > > I wrote some piece of code using divert socket to read packets from > the divert port , but no result ... > > I think I'm missing something , > > so please enlighten my mind ... > > > Many Thanks > > > -- > Saber > > > > > >------------------------------------------------------------------------ > > >/*#include >#include >#include >#include >#include >#include >#include >*/ >#include /* NB: we rely on this for */ >#include >#include >#include >#include > >#include >#include >#include >#include >#include >#include > >#ifdef IPSEC >#include >#endif /*IPSEC*/ > >#include >#include >#include >#include >#include >#include >#include >#include >#include >#include >#include >#include > > >#define BUFSIZE 65535 > > >int >main(int argc, char **argv) >{ > int fd, rawfd, fdfw, ret, n; > int on = 1; > struct sockaddr_in bindPort, sin; > int sinlen; > int port_nb; > struct ip *hdr; > unsigned char packet[BUFSIZE]; > struct in_addr addr; > int i, direction; > struct ip_mreq mreq; > > if (argc != 2) { > fprintf(stderr, "Usage: %s \n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > > fprintf(stderr, "%s:Creating a socket\n", argv[0]); > /* open a divert socket */ > fd = socket(AF_INET, SOCK_RAW, IPPROTO_DIVERT); > > if (fd == -1) { > fprintf(stderr, "%s:We could not open a divert socket\n", argv[0]); > exit(1); > } > bindPort.sin_family = AF_INET; > bindPort.sin_port = htons(atol(argv[1])); > bindPort.sin_addr.s_addr = 0; > > fprintf(stderr, "%s:Binding a socket\n", argv[0]); > ret = bind(fd, (struct sockaddr*)&bindPort, sizeof(struct sockaddr_in)); > > if (ret != 0) { > close(fd); > fprintf(stderr, "%s: Error bind(): %s", argv[0], strerror(ret)); > exit(2); > } > printf("%s: Waiting for data...\n", argv[0]); > /* read data in */ > sinlen = sizeof(struct sockaddr_in); > while (1) { > n = recvfrom(fd, packet, BUFSIZE, 0, (struct sockaddr*)&sin, &sinlen); > hdr = (struct ip *) packet; > > printf("%s: The packet looks like this:\n", argv[0]); > for (i = 0; i < 40; i++) { > printf("%02x ", (int)*(packet + i)); > if (!((i + 1) % 16)) > printf("\n"); > }; > printf("\n"); > > printf("%s: Source address: %s\n", argv[0], inet_ntoa(hdr->ip_src)); > printf("%s: Destination address: %s\n", argv[0], inet_ntoa(hdr->ip_dst)); > printf("%s: Receiving IF address: %s\n", argv[0], inet_ntoa(sin.sin_addr)); > printf("%s: Protocol number: %i\n", argv[0], hdr->ip_p); > > } >} > > >------------------------------------------------------------------------ > >_______________________________________________ >freebsd-net@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-net >To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > From owner-freebsd-hackers@FreeBSD.ORG Mon Sep 27 23:24:59 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 5C7DD16A4CF for ; Mon, 27 Sep 2004 23:24:59 +0000 (GMT) Received: from tower.berklix.org (bsd.bsn.com [194.221.32.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C25143D49 for ; Mon, 27 Sep 2004 23:24:58 +0000 (GMT) (envelope-from jhs@flat.berklix.net) Received: from js.berklix.net (pD950E022.dip.t-dialin.net [217.80.224.34]) (authenticated bits=0) by tower.berklix.org (8.12.9p2/8.12.9) with ESMTP id i8RNOkhB019089; Tue, 28 Sep 2004 01:24:47 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from laps.jhs.private (laps.jhs.private [192.168.91.56]) by js.berklix.net (8.12.11/8.12.11) with ESMTP id i8RNOgd5003254; Tue, 28 Sep 2004 01:24:42 +0200 (CEST) (envelope-from jhs@flat.berklix.net) Received: from laps.jhs.private (localhost [127.0.0.1]) by laps.jhs.private (8.13.1/8.13.1) with ESMTP id i8RNOfds008071; Tue, 28 Sep 2004 01:24:41 +0200 (CEST) (envelope-from jhs@laps.jhs.private) Message-Id: <200409272324.i8RNOfds008071@laps.jhs.private> To: John Von Essen In-Reply-To: Message from John Von Essen <6ACEE66C-10B6-11D9-A5BE-0003933DDCFA@essenz.com> Date: Tue, 28 Sep 2004 01:24:41 +0200 From: "Julian H. Stacey" X-Mailman-Approved-At: Tue, 28 Sep 2004 14:53:52 +0000 cc: freebsd-hackers@freebsd.org Subject: Re: hacking SCO.... 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, 27 Sep 2004 23:24:59 -0000 John Von Essen wrote: > Unfortunately, I have inherited a Intel P200 with SCO OpenServer 5.0.4 > with a 4Gb SCSI drive. Condolences ! SCO is Horrible to work on, & a waste of time, erase ASAP ! ........ > SCO is of no help, they cant provide replacement boot floppy, only sell > me complete distribution version 5.0.7 for $100. > Any ideas on how I should go about this. All I need to do is get that > data from the tape onto the disk and I should good to go. > SCO is of no help, they cant provide replacement boot floppy, only sell > me complete distribution version 5.0.7 for $100. SCO used to give away licences free for 5.0.4 &/or 5.0.5 for restricted use. One could legally download cdrom images & burn them. Good denough to rescue data & then erase SCO & install BSD If you can't rescue the data while running FreeBSD, either: Non Commercial solution: Look around find someone near who has a 5.0.4 or 5 cdrom, (maybe even SCO site somewhere) get a copy, (cdrom contains floppy images too I recall), rescue data, delete SCO very quickly from your machine, (before you discover the pain of running SCO, (& if you really must run SCO then Do get their Skunkware CDROM too (yes that's it's real name! it's full of FSF/GNU stuff & free & makes using SCO rather less unpleasant (not unpleasant, just rather less). Commercial solution. Pay the $100, if its for a commercial job it's cheap. No point quibbling. SCO used to cost about 2000 German Deutschmarks, for end users, (& was the Unix I found most crippled. BSD is cheaper, but if it's for business, & it's their legal right, cheap enough. There's SCO forums somewhere, but probably the wrong route. Their manuals used to just present work-rounds for obsolete old software everyone else wasn't using anymore eg at one stage they were SVR3 & all other vendors were SVR4 based. Last time I was contracted to work on SCO, I just kept tossing more modern source eg X11R6 & lesstif & GNU src/ on top of the base obsolete SCO, till obsolete SCO libraries no longer broke my project. Reading SCO manuals was a waste of time, better to just to rip it out & replace it with better software, either per utility that annoys, or per whole OS. - Julian Stacey. Unix,C,Net & Sys. Eng. Consultant, Munich. http://berklix.com Mail in Ascii, Html dumped as Spam. Ihr Rauch = mein allergischer Kopfschmerz. From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 05:05: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 1F85816A4CE for ; Tue, 28 Sep 2004 05:05:39 +0000 (GMT) Received: from turtle.freedns.us (netblock-66-159-221-76.dslextreme.com [66.159.221.76]) by mx1.FreeBSD.org (Postfix) with ESMTP id A65C943D55 for ; Tue, 28 Sep 2004 05:05:38 +0000 (GMT) (envelope-from bt@turtle.freedns.us) Received: from turtle.freedns.us (localhost [127.0.0.1]) by turtle.freedns.us (8.12.11/8.12.3) with ESMTP id i8S55cko004952 for ; Mon, 27 Sep 2004 22:05:38 -0700 (PDT) (envelope-from bt@turtle.freedns.us) Message-ID: <4158F121.4010403@turtle.freedns.us> Date: Mon, 27 Sep 2004 22:05:37 -0700 From: Igor Serikov Organization: Private Person User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20030209 X-Accept-Language: ru, en MIME-Version: 1.0 To: FreeBSD Hackers Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Tue, 28 Sep 2004 14:55:49 +0000 Subject: Midnight Commander 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, 28 Sep 2004 05:05:39 -0000 Hello, World! Can somebody explain me why Midnight Commander always says "cannot chdir to ..." whenever I do something on his right panel? When I switch pannels using Crtl+U command, the left panel gets into the same trouble. Igor. From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 10:36: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 7FE1F16A4CE; Tue, 28 Sep 2004 10:36:25 +0000 (GMT) Received: from mail.star-sw.com (mail.star-sw.com [217.195.82.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34FBE43D31; Tue, 28 Sep 2004 10:36:24 +0000 (GMT) (envelope-from nkritsky@star-sw.com) Received: from ARGON.star-sw.com (argon.star-sw.com [217.195.82.10]) by mail.star-sw.com (8.12.11/8.12.11) with ESMTP id i8SAaI7n009918; Tue, 28 Sep 2004 14:36:18 +0400 (MSD) Received: from ibmka.star-sw.com ([192.168.32.230]) by ARGON.star-sw.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 28 Sep 2004 14:23:56 +0400 Date: Tue, 28 Sep 2004 14:23:56 +0400 From: "Nickolay A. Kritsky" X-Mailer: The Bat! (v1.49) Personal X-Priority: 3 (Normal) Message-ID: <381891561234.20040928142356@star-sw.com> To: Zrelli Saber Ben Mohamed In-reply-To: <41593824.9030006@jaist.ac.jp> References: <41593824.9030006@jaist.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Sep 2004 10:23:56.0537 (UTC) FILETIME=[42CE7690:01C4A545] X-Mailman-Approved-At: Tue, 28 Sep 2004 14:53:52 +0000 cc: freebsd-net@freebsd.org cc: hackers@freebsd.org cc: net@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: divert , ipfw question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Nickolay A. Kritsky" List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2004 10:36:25 -0000 Hello Zrelli, the rule 65000 allow ip from any to any stops processing of a packet, so it will never reach diverting rule 65100. see man ipfw about rule-processing Tuesday, September 28, 2004, 2:08:36 PM, Zrelli Saber Ben Mohamed wrote: ZSBM> Hi , ZSBM> I'm interesed in the "divert" mechanism and want to try it out , ZSBM> so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding the ZSBM> IPDIVERT option and then added the needed lines in the rc.conf file, ZSBM> after that , I set up ipfw to divert packets to some port ZSBM> here is my ipfw rule set . ZSBM> 00100 allow ip from any to any via lo0 ZSBM> 00200 deny ip from any to 127.0.0.0/8 ZSBM> 00300 deny ip from 127.0.0.0/8 to any ZSBM> 65000 allow ip from any to any ZSBM> 65100 divert 5000 ip from any 22 to me <---- the divert rule ZSBM> 65535 deny ip from any to any ZSBM> then, I wanted to monitor the diverted traffic using tcpdump : ZSBM> $ tcpdump port 5000 ZSBM> when I do a telnet connection to the port 22 from a remote host , I was ZSBM> expecting that tcpdump will display packets diverted to the port 5000 by ZSBM> ipfw. ZSBM> The remote host I use shows that it connects to port 22 and the ipfw ZSBM> divert rule seems not to work. ZSBM> I can set another rule to block the traffic in the port 22 , and it works. ZSBM> only the divert rule seems to fail. ZSBM> I wrote some piece of code using divert socket to read packets from the ZSBM> divert port , but no result ... ZSBM> I think I'm missing something , ZSBM> so please enlighten my mind ... ZSBM> Many Thanks ZSBM> -- ZSBM> Saber -- Best regards, ; Nickolay A. Kritsky ; SysAdmin STAR Software LLC ; mailto:nkritsky@star-sw.com From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 10:36: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 7FE1F16A4CE; Tue, 28 Sep 2004 10:36:25 +0000 (GMT) Received: from mail.star-sw.com (mail.star-sw.com [217.195.82.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34FBE43D31; Tue, 28 Sep 2004 10:36:24 +0000 (GMT) (envelope-from nkritsky@star-sw.com) Received: from ARGON.star-sw.com (argon.star-sw.com [217.195.82.10]) by mail.star-sw.com (8.12.11/8.12.11) with ESMTP id i8SAaI7n009918; Tue, 28 Sep 2004 14:36:18 +0400 (MSD) Received: from ibmka.star-sw.com ([192.168.32.230]) by ARGON.star-sw.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 28 Sep 2004 14:23:56 +0400 Date: Tue, 28 Sep 2004 14:23:56 +0400 From: "Nickolay A. Kritsky" X-Mailer: The Bat! (v1.49) Personal X-Priority: 3 (Normal) Message-ID: <381891561234.20040928142356@star-sw.com> To: Zrelli Saber Ben Mohamed In-reply-To: <41593824.9030006@jaist.ac.jp> References: <41593824.9030006@jaist.ac.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Sep 2004 10:23:56.0537 (UTC) FILETIME=[42CE7690:01C4A545] X-Mailman-Approved-At: Tue, 28 Sep 2004 14:53:52 +0000 cc: freebsd-net@freebsd.org cc: hackers@freebsd.org cc: net@freebsd.org cc: freebsd-hackers@freebsd.org Subject: Re: divert , ipfw question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: "Nickolay A. Kritsky" List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2004 10:36:25 -0000 Hello Zrelli, the rule 65000 allow ip from any to any stops processing of a packet, so it will never reach diverting rule 65100. see man ipfw about rule-processing Tuesday, September 28, 2004, 2:08:36 PM, Zrelli Saber Ben Mohamed wrote: ZSBM> Hi , ZSBM> I'm interesed in the "divert" mechanism and want to try it out , ZSBM> so I recompiled the kernel ( FreeBSD 5.2.1-RELEASE #0 ) after adding the ZSBM> IPDIVERT option and then added the needed lines in the rc.conf file, ZSBM> after that , I set up ipfw to divert packets to some port ZSBM> here is my ipfw rule set . ZSBM> 00100 allow ip from any to any via lo0 ZSBM> 00200 deny ip from any to 127.0.0.0/8 ZSBM> 00300 deny ip from 127.0.0.0/8 to any ZSBM> 65000 allow ip from any to any ZSBM> 65100 divert 5000 ip from any 22 to me <---- the divert rule ZSBM> 65535 deny ip from any to any ZSBM> then, I wanted to monitor the diverted traffic using tcpdump : ZSBM> $ tcpdump port 5000 ZSBM> when I do a telnet connection to the port 22 from a remote host , I was ZSBM> expecting that tcpdump will display packets diverted to the port 5000 by ZSBM> ipfw. ZSBM> The remote host I use shows that it connects to port 22 and the ipfw ZSBM> divert rule seems not to work. ZSBM> I can set another rule to block the traffic in the port 22 , and it works. ZSBM> only the divert rule seems to fail. ZSBM> I wrote some piece of code using divert socket to read packets from the ZSBM> divert port , but no result ... ZSBM> I think I'm missing something , ZSBM> so please enlighten my mind ... ZSBM> Many Thanks ZSBM> -- ZSBM> Saber -- Best regards, ; Nickolay A. Kritsky ; SysAdmin STAR Software LLC ; mailto:nkritsky@star-sw.com From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 16:56: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 D42D416A4CE for ; Tue, 28 Sep 2004 16:56:58 +0000 (GMT) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4BF643D5C for ; Tue, 28 Sep 2004 16:56:55 +0000 (GMT) (envelope-from maxim@macomnet.ru) Received-SPF: pass (mp2.macomnet.net: domain of maxim@macomnet.ru designates 127.0.0.1 as permitted sender) receiver=mp2.macomnet.net; client_ip=127.0.0.1; envelope-from=maxim@macomnet.ru; Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.12.11/8.12.11) with ESMTP id i8SGuswm025901 for ; Tue, 28 Sep 2004 20:56:54 +0400 (MSD) (envelope-from maxim@macomnet.ru) Date: Tue, 28 Sep 2004 20:56:54 +0400 (MSD) From: Maxim Konovalov To: hackers@freebsd.org Message-ID: <20040928205116.T25866@mp2.macomnet.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: ping(8) 64BTT friendly patch 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, 28 Sep 2004 16:56:59 -0000 Here is a patch stolen from OpenBSD via NetBSD (rev. 1.75 ping/ping.c) which does two things: - stores timestamp in network byte order; - removes an assumption that sizeof(struct timeval) == 8 (it's not true on sparc64). Any comments? Index: ping.c =================================================================== RCS file: /home/ncvs/src/sbin/ping/ping.c,v retrieving revision 1.105 diff -u -r1.105 ping.c --- ping.c 14 Aug 2004 17:46:10 -0000 1.105 +++ ping.c 28 Sep 2004 14:51:04 -0000 @@ -92,7 +92,7 @@ #include #define INADDR_LEN ((int)sizeof(in_addr_t)) -#define TIMEVAL_LEN ((int)sizeof(struct timeval)) +#define TIMEVAL_LEN ((int)sizeof(struct tv32)) #define MASK_LEN (ICMP_MASKLEN - ICMP_MINLEN) #define TS_LEN (ICMP_TSLEN - ICMP_MINLEN) #define DEFDATALEN 56 /* default data length */ @@ -110,6 +110,11 @@ #define CLR(bit) (A(bit) &= (~B(bit))) #define TST(bit) (A(bit) & B(bit)) +struct tv32 { + int32_t tv32_sec; + int32_t tv32_usec; +}; + /* various options */ int options; #define F_FLOOD 0x0001 @@ -838,6 +843,7 @@ pinger(void) { struct timeval now; + struct tv32 tv32; struct ip *ip; struct icmp *icp; int cc, i; @@ -856,13 +862,15 @@ if ((options & F_TIME) || timing) { (void)gettimeofday(&now, NULL); + tv32.tv32_sec = htonl(now.tv_sec); + tv32.tv32_usec = htonl(now.tv_usec); if (options & F_TIME) icp->icmp_otime = htonl((now.tv_sec % (24*60*60)) * 1000 + now.tv_usec / 1000); if (timing) - bcopy((void *)&now, + bcopy((void *)&tv32, (void *)&outpack[ICMP_MINLEN + phdr_len], - sizeof(struct timeval)); + sizeof(tv32)); } cc = ICMP_MINLEN + phdr_len + datalen; @@ -942,6 +950,7 @@ triptime = 0.0; if (timing) { struct timeval tv1; + struct tv32 tv32; #ifndef icmp_data tp = &icp->icmp_ip; #else @@ -951,7 +960,9 @@ if (cc - ICMP_MINLEN - phdr_len >= sizeof(tv1)) { /* Copy to avoid alignment problems: */ - memcpy(&tv1, tp, sizeof(tv1)); + memcpy(&tv32, tp, sizeof(tv32)); + tv1.tv_sec = ntohl(tv32.tv32_sec); + tv1.tv_usec = ntohl(tv32.tv32_usec); tvsub(tv, &tv1); triptime = ((double)tv->tv_sec) * 1000.0 + ((double)tv->tv_usec) / 1000.0; %%% -- Maxim Konovalov From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 20:59: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 68A6D16A4CE; Tue, 28 Sep 2004 20:59:21 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3F63643D45; Tue, 28 Sep 2004 20:59:21 +0000 (GMT) (envelope-from csjp@freebsd.org) Received: from freefall.freebsd.org (csjp@localhost [127.0.0.1]) i8SKxLQO001543; Tue, 28 Sep 2004 20:59:21 GMT (envelope-from csjp@freebsd.org) Received: (from csjp@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i8SKxKbW001542; Tue, 28 Sep 2004 20:59:20 GMT (envelope-from csjp@freebsd.org) X-Authentication-Warning: freefall.freebsd.org: csjp set sender to csjp@freebsd.org using -f Date: Tue, 28 Sep 2004 20:59:20 +0000 From: "Christian S.J. Peron" To: Wiktor Niesiobedzki Message-ID: <20040928205920.GA1459@freefall.freebsd.org> References: <20040924223754.GA86799@freefall.freebsd.org> <20040928180100.GE1760@mail.evip.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040928180100.GE1760@mail.evip.pl> User-Agent: Mutt/1.4.1i cc: max@love2party.net cc: hackers@freebsd.org cc: ipfw@freebsd.org cc: freebsd-pf@freebsd.org Subject: Re: fixes for ipfw and pf lock ordering issues 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, 28 Sep 2004 20:59:21 -0000 On 28 Sep 2004 Wiktor Niesiobedzki wrote: > pf_socket_lookup(cbb24958,cbb2495c,2,cbb24a0c,c15275a0) at > pf_socket_lookup+0x22 > pf_test_tcp(cbb249c0,cbb249bc,2,c14d6200,c139e500) at pf_test_tcp+0x648 > pf_test(2,c14b8014,cbb24aa8,c15275a0,c15661c0) at pf_test+0x53d > pf_check_out(0,cbb24aa8,c14b8014,2,c15275a0) at pf_check_out+0x6d > pfil_run_hooks(c066da00,cbb24b1c,c14b8014,2,c15275a0) at pfil_run_hooks+0xeb > ip_output(c139e500,0,cbb24ae8,0,0) at ip_output+0x630 > tcp_twrespond(c18709a0,10,c0607304,69c,1) at tcp_twrespond+0x1ed > tcp_twstart(c186b380,0,c0606ba2,96f,0) at tcp_twstart+0x1d3 > tcp_input(c139d800,14,c14b8014,1,0) at tcp_input+0x2c39 > ip_input(c139d800,0,c06053ae,e7,c066d098) at ip_input+0x5b0 > netisr_processqueue(c066d098,c0642940,1,c05fb4da,c10d62c0) at > netisr_processqueu > e+0x8e > swi_net(0,0,c05f9b18,269,0) at swi_net+0xe9 > ithread_loop(c10de480,cbb24d48,c05f990f,31f,1000000) at ithread_loop+0x172 > fork_exit(c04a6520,c10de480,cbb24d48) at fork_exit+0xc6 > fork_trampoline() at fork_trampoline+0x8 > --- trap 0x1, eip = 0, esp = 0xcbb24d7c, ebp = 0 --- > db> > > db> show locks > exclusive sleep mutex inp (tcpinp) r = 0 (0xc1527630) locked @ > /usr/src/sys/neti > net/tcp_input.c:737 > exclusive sleep mutex tcp r = 0 (0xc066de6c) locked @ > /usr/src/sys/netinet/tcp_i > nput.c:611 > db> > > (gdb) l *pf_socket_lookup+0x22 > 0xc043a2d2 is in pf_socket_lookup (/usr/src/sys/contrib/pf/net/pf.c:2414). > 2409 #endif > 2410 struct inpcb *inp; > 2411 > 2412 #ifdef __FreeBSD__ > 2413 if (inp_arg != NULL) { > 2414 *uid = inp_arg->inp_socket->so_cred->cr_uid; > 2415 *gid = inp_arg->inp_socket->so_cred->cr_groups[0]; > 2416 return (1); > 2417 } > 2418 #endif > Looks like it could be a bad pointer dereference, have you recompiled your kernel and the pf/ipfw modules? If not, please try recompiling your kernel. otherwise I will keep hunting for potentially bad pointers being passed to the pfil hooks -- Christian S.J. Peron csjp@FreeBSD.ORG FreeBSD Committer From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 23:22: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 17AF716A4FB; Tue, 28 Sep 2004 23:22:54 +0000 (GMT) Received: from pony2pub.arc.nasa.gov (pony2pub.arc.nasa.gov [128.102.31.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id E768843D1D; Tue, 28 Sep 2004 23:22:49 +0000 (GMT) (envelope-from jtoung@arc.nasa.gov) Received: from mrcrab.nas.nasa.gov ([129.99.139.47] verified) by pony2pub.arc.nasa.gov (CommuniGate Pro SMTP 4.1.8) with ESMTP id 13950755; Tue, 28 Sep 2004 16:22:49 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Jerry Toung To: "Greg 'groggy' Lehey" Date: Tue, 28 Sep 2004 16:22:29 -0700 User-Agent: KMail/1.4.3 References: <200409241628.43022.jtoung@earthlink.net> <200409271107.21241.jtoung@arc.nasa.gov> <20040928015212.GN12394@wantadilla.lemis.com> In-Reply-To: <20040928015212.GN12394@wantadilla.lemis.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200409281622.29556.jtoung@arc.nasa.gov> cc: Mark Teel cc: freebsd-hackers@freebsd.org Subject: Re: remote debugging question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jtoung@arc.nasa.gov List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Sep 2004 23:22:54 -0000 Hi Greg, thank you for all the feedback. The "set remotebaud 1" thing in my previo= us=20 email was a typo, I usually enter 9600.=20 So you're saying that I may have a communication problem. I would like to= =20 point out that I can use "cu -l cuaa0 -s 9600" on both side and all is we= ll.=20 What do you think could cause this communication issue? I will run anothe= r=20 cvsup soon. May be a bug in 6.0current for kgdb. On Monday 27 September 2004 06:52 pm, Greg 'groggy' Lehey wrote: > > You'll need the sources as well, but that's the next problem, not the > one you're experiencing. > as for the sources that I am supposed to transfer to B (the remote), are = you=20 talking about /usr/src of A or /usr/obj of A or both? then mount_nfs? My next option will be firewire. thank you, Jerry From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 00:56: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 7807C16A4CE; Wed, 29 Sep 2004 00:56:15 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id D8ABA43D39; Wed, 29 Sep 2004 00:56:14 +0000 (GMT) (envelope-from max@love2party.net) Received: from [212.227.126.205] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CCSlN-0002vk-00; Wed, 29 Sep 2004 02:56:09 +0200 Received: from [217.83.9.48] (helo=donor.laier.local) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1CCSlM-0007Nd-00; Wed, 29 Sep 2004 02:56:08 +0200 From: Max Laier To: Wiktor Niesiobedzki Date: Wed, 29 Sep 2004 02:55:09 +0200 User-Agent: KMail/1.7 References: <20040924223754.GA86799@freefall.freebsd.org> <20040928180100.GE1760@mail.evip.pl> In-Reply-To: <20040928180100.GE1760@mail.evip.pl> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7562195.AI5OhU5A9J"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200409290255.22309.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:61c499deaeeba3ba5be80f48ecc83056 cc: ipfw@freebsd.org cc: hackers@freebsd.org cc: "Christian S.J. Peron" cc: freebsd-pf@freebsd.org Subject: Re: fixes for ipfw and pf lock ordering issues 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, 29 Sep 2004 00:56:15 -0000 --nextPart7562195.AI5OhU5A9J Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 28 September 2004 20:01, Wiktor Niesiobedzki wrote: > On Fri, Sep 24, 2004 at 10:37:54PM +0000, Christian S.J. Peron wrote: > > Good day folks, we need some beta testers > > Hi, as an author of LOR reports I feel obliged to test this patch. I was > running it for a 2 days and intended to report, that for me everything > works ok, when an panic occured. Regretably, I do not have actual panic > message, but the trace looks as follows: > pf_socket_lookup(cbb24958,cbb2495c,2,cbb24a0c,c15275a0) at > pf_socket_lookup+0x22 > pf_test_tcp(cbb249c0,cbb249bc,2,c14d6200,c139e500) at pf_test_tcp+0x648 > pf_test(2,c14b8014,cbb24aa8,c15275a0,c15661c0) at pf_test+0x53d > pf_check_out(0,cbb24aa8,c14b8014,2,c15275a0) at pf_check_out+0x6d > pfil_run_hooks(c066da00,cbb24b1c,c14b8014,2,c15275a0) at > pfil_run_hooks+0xeb ip_output(c139e500,0,cbb24ae8,0,0) at ip_output+0x630 > tcp_twrespond(c18709a0,10,c0607304,69c,1) at tcp_twrespond+0x1ed > tcp_twstart(c186b380,0,c0606ba2,96f,0) at tcp_twstart+0x1d3 > tcp_input(c139d800,14,c14b8014,1,0) at tcp_input+0x2c39 > ip_input(c139d800,0,c06053ae,e7,c066d098) at ip_input+0x5b0 > netisr_processqueue(c066d098,c0642940,1,c05fb4da,c10d62c0) at > netisr_processqueu > e+0x8e > swi_net(0,0,c05f9b18,269,0) at swi_net+0xe9 > ithread_loop(c10de480,cbb24d48,c05f990f,31f,1000000) at ithread_loop+0x172 > fork_exit(c04a6520,c10de480,cbb24d48) at fork_exit+0xc6 > fork_trampoline() at fork_trampoline+0x8 > --- trap 0x1, eip =3D 0, esp =3D 0xcbb24d7c, ebp =3D 0 --- > db> > > db> show locks > exclusive sleep mutex inp (tcpinp) r =3D 0 (0xc1527630) locked @ > /usr/src/sys/neti > net/tcp_input.c:737 > exclusive sleep mutex tcp r =3D 0 (0xc066de6c) locked @ > /usr/src/sys/netinet/tcp_i > nput.c:611 > db> > > (gdb) l *pf_socket_lookup+0x22 > 0xc043a2d2 is in pf_socket_lookup (/usr/src/sys/contrib/pf/net/pf.c:2414). > 2409 #endif > 2410 struct inpcb *inp; > 2411 > 2412 #ifdef __FreeBSD__ > 2413 if (inp_arg !=3D NULL) { > 2414 *uid =3D inp_arg->inp_socket->so_cred->cr_uid; > 2415 *gid =3D inp_arg->inp_socket->so_cred->cr_groups[= 0]; > 2416 return (1); > 2417 } > 2418 #endif This should read: > *uid =3D UID_MAX; > *gid =3D GID_MAX; > #ifdef __FreeBSD__ > if (inp_arg !=3D NULL) { > if (inp_arg->inp_socket) { > *uid =3D inp_arg->inp_socket->so_cred->cr_uid; > *gid =3D inp_arg->inp_socket->so_cred->cr_groups[= 0]; > return (1); > } else > return (0); > } > #endif now. Thanks for testing, I will post an updated patch the other day. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart7562195.AI5OhU5A9J Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBWgf6XyyEoT62BG0RAgx5AJ9/RQ971H3oQ18mYgo19wD/XBXiIACeMqsD JSk9Pz90fJXmrHlvsBlyNgE= =Fs+l -----END PGP SIGNATURE----- --nextPart7562195.AI5OhU5A9J-- From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 01:55: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 12CF216A4CE for ; Wed, 29 Sep 2004 01:55:52 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43DDD43D46 for ; Wed, 29 Sep 2004 01:55:48 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by mproxy.gmail.com with SMTP id 74so40203rnk for ; Tue, 28 Sep 2004 18:55:47 -0700 (PDT) Received: by 10.38.59.51 with SMTP id h51mr1445230rna; Tue, 28 Sep 2004 18:55:47 -0700 (PDT) Received: by 10.38.13.17 with HTTP; Tue, 28 Sep 2004 18:55:47 -0700 (PDT) Message-ID: <84dead7204092818555acdeffd@mail.gmail.com> Date: Wed, 29 Sep 2004 07:25:47 +0530 From: Joseph Koshy To: Ralph Huntington In-Reply-To: <20011126084254.I54163-100000@mohegan.mohawk.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <200111261334.fAQDY4c95306@star.rila.bg> <20011126084254.I54163-100000@mohegan.mohawk.net> cc: freebsd-hackers@freebsd.org cc: dwbear75@gmail.com cc: freebsd-security@freebsd.org Subject: Re: Strange FTPD behavior X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joseph Koshy List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2004 01:55:52 -0000 You could use ktrace(1) to determine what the ftpd daemon is actually doing. rh> Is the user's shell listed in /etc/shells? It must be there for ftpd to rh> let them in. vt> I run FreeBSD 4.3-STABLE machine. I use ftpd for ftp server daemon. It has vt> very strange behavior with one of user accounts on my machine. Every one user From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 07:14: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 E3A7516A4CE for ; Wed, 29 Sep 2004 07:14:01 +0000 (GMT) Received: from www.citello.it (host170-131.pool80117.interbusiness.it [80.117.131.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0202B43D54 for ; Wed, 29 Sep 2004 07:14:01 +0000 (GMT) (envelope-from molter@tin.it) Received: from gattaccio.codalunga (ANice-205-1-10-65.w81-248.abo.wanadoo.fr [81.248.120.65]) by www.citello.it (Postfix) with ESMTP id 2A1D0323; Wed, 29 Sep 2004 09:13:38 +0200 (CEST) Received: by gattaccio.codalunga (Postfix, from userid 1001) id 000A1C10C; Wed, 29 Sep 2004 09:11:58 +0200 (CEST) Date: Wed, 29 Sep 2004 09:11:58 +0200 From: Marco Molteni To: jtoung@arc.nasa.gov Message-Id: <20040929091158.7569f37f.molter@tin.it> In-Reply-To: <200409281622.29556.jtoung@arc.nasa.gov> References: <200409241628.43022.jtoung@earthlink.net> <200409271107.21241.jtoung@arc.nasa.gov> <20040928015212.GN12394@wantadilla.lemis.com> <200409281622.29556.jtoung@arc.nasa.gov> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i386-portbld-freebsd5.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: remote debugging question 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, 29 Sep 2004 07:14:02 -0000 On Tue, 28 Sep 2004 16:22:29 -0700 Jerry Toung wrote: > Hi Greg, > thank you for all the feedback. The "set remotebaud 1" thing in my > previous email was a typo, I usually enter 9600. > So you're saying that I may have a communication problem. I would like > to point out that I can use "cu -l cuaa0 -s 9600" on both side and all > is well. What do you think could cause this communication issue? I > will run another cvsup soon. May be a bug in 6.0current for kgdb. [..] Note also that you need a -current after 15 sept 2004 to be able to properly set breakpoints and obtain a backtrace without crashing the kernel. (See the commit log for src/sys/i386/i386/gdb_machdep.c for details). marco -- panic("The moon has moved again."); From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 28 18:01: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 5D6AA16A4CE; Tue, 28 Sep 2004 18:01:16 +0000 (GMT) Received: from mail.evip.pl (mail.evip.com.pl [212.244.157.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3ACD843D39; Tue, 28 Sep 2004 18:01:15 +0000 (GMT) (envelope-from w@evip.pl) Received: from drwebc by mail.evip.pl with drweb-scanned (Exim 4.22) id 1CCMHd-0003AU-3X; Tue, 28 Sep 2004 20:01:01 +0200 Received: from w by mail.evip.pl with local (Exim 4.22) id 1CCMHd-0003AO-0G; Tue, 28 Sep 2004 20:01:01 +0200 Date: Tue, 28 Sep 2004 20:01:00 +0200 From: Wiktor Niesiobedzki To: "Christian S.J. Peron" Message-ID: <20040928180100.GE1760@mail.evip.pl> References: <20040924223754.GA86799@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040924223754.GA86799@freefall.freebsd.org> User-Agent: Mutt/1.5.6i X-Mailman-Approved-At: Wed, 29 Sep 2004 12:04:30 +0000 cc: max@love2party.net cc: hackers@freebsd.org cc: ipfw@freebsd.org cc: freebsd-pf@freebsd.org Subject: Re: fixes for ipfw and pf lock ordering issues 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, 28 Sep 2004 18:01:16 -0000 On Fri, Sep 24, 2004 at 10:37:54PM +0000, Christian S.J. Peron wrote: > Good day folks, we need some beta testers > Hi, as an author of LOR reports I feel obliged to test this patch. I was running it for a 2 days and intended to report, that for me everything works ok, when an panic occured. Regretably, I do not have actual panic message, but the trace looks as follows: pf_socket_lookup(cbb24958,cbb2495c,2,cbb24a0c,c15275a0) at pf_socket_lookup+0x22 pf_test_tcp(cbb249c0,cbb249bc,2,c14d6200,c139e500) at pf_test_tcp+0x648 pf_test(2,c14b8014,cbb24aa8,c15275a0,c15661c0) at pf_test+0x53d pf_check_out(0,cbb24aa8,c14b8014,2,c15275a0) at pf_check_out+0x6d pfil_run_hooks(c066da00,cbb24b1c,c14b8014,2,c15275a0) at pfil_run_hooks+0xeb ip_output(c139e500,0,cbb24ae8,0,0) at ip_output+0x630 tcp_twrespond(c18709a0,10,c0607304,69c,1) at tcp_twrespond+0x1ed tcp_twstart(c186b380,0,c0606ba2,96f,0) at tcp_twstart+0x1d3 tcp_input(c139d800,14,c14b8014,1,0) at tcp_input+0x2c39 ip_input(c139d800,0,c06053ae,e7,c066d098) at ip_input+0x5b0 netisr_processqueue(c066d098,c0642940,1,c05fb4da,c10d62c0) at netisr_processqueu e+0x8e swi_net(0,0,c05f9b18,269,0) at swi_net+0xe9 ithread_loop(c10de480,cbb24d48,c05f990f,31f,1000000) at ithread_loop+0x172 fork_exit(c04a6520,c10de480,cbb24d48) at fork_exit+0xc6 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xcbb24d7c, ebp = 0 --- db> db> show locks exclusive sleep mutex inp (tcpinp) r = 0 (0xc1527630) locked @ /usr/src/sys/neti net/tcp_input.c:737 exclusive sleep mutex tcp r = 0 (0xc066de6c) locked @ /usr/src/sys/netinet/tcp_i nput.c:611 db> (gdb) l *pf_socket_lookup+0x22 0xc043a2d2 is in pf_socket_lookup (/usr/src/sys/contrib/pf/net/pf.c:2414). 2409 #endif 2410 struct inpcb *inp; 2411 2412 #ifdef __FreeBSD__ 2413 if (inp_arg != NULL) { 2414 *uid = inp_arg->inp_socket->so_cred->cr_uid; 2415 *gid = inp_arg->inp_socket->so_cred->cr_groups[0]; 2416 return (1); 2417 } 2418 #endif (gdb) l *pf_test_tcp+0x648 0xc043aef8 is in pf_test_tcp (/usr/src/sys/contrib/pf/net/pf.c:2781). 2776 r = TAILQ_NEXT(r, entries); 2777 else if (r->rule_flag & PFRULE_FRAGMENT) 2778 r = TAILQ_NEXT(r, entries); 2779 else if ((r->flagset & th->th_flags) != r->flags) 2780 r = TAILQ_NEXT(r, entries); 2781 else if (r->uid.op && (lookup != -1 || (lookup = 2782 #ifdef __FreeBSD__ 2783 pf_socket_lookup(&uid, &gid, direction, pd, inp), 1)) && 2784 #else 2785 pf_socket_lookup(&uid, &gid, direction, pd), 1)) && If there is anything more I may provide, please tell me. I can't get my kernel dumps on, although I have KDB_UNATTENDED option in kernel, it gaves me prompt on panics, and when I call panic from debugger I get hangs :S If you know any other way to get the panic message, I'd appreciate. My comments for the patch alone: Before the patch, I got the LOR's and rather rare panics due to this problem. They were happening mainly when changing PF rules, sometimes on shutdown. After the patch, I do not have any LOR messages, I tried to load PF rules in a loop for a few minutes. After that I just left the system for it own, while there was some activity on network (and particularly on rules with uid matching). Till today I was quite happy with that. If there is anything I can debug more, to help you solve the problem, please ask. Cheers, Wiktor Niesiobedzki PS. Just for the record - I tired it only with PF. I'm also planning to give it a shot with my old IPFW rules. From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 08:56: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 C2E7116A4CE for ; Wed, 29 Sep 2004 08:56:48 +0000 (GMT) Received: from turtle.freedns.us (netblock-66-159-221-76.dslextreme.com [66.159.221.76]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40B2443D49 for ; Wed, 29 Sep 2004 08:56:46 +0000 (GMT) (envelope-from bt@turtle.freedns.us) Received: from turtle.freedns.us (localhost [127.0.0.1]) by turtle.freedns.us (8.12.11/8.12.3) with ESMTP id i8T8ujMZ000383 for ; Wed, 29 Sep 2004 01:56:45 -0700 (PDT) (envelope-from bt@turtle.freedns.us) Message-ID: <415A78CD.9080900@turtle.freedns.us> Date: Wed, 29 Sep 2004 01:56:45 -0700 From: Igor Serikov Organization: Private Person User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.1) Gecko/20030209 X-Accept-Language: ru, en MIME-Version: 1.0 To: FreeBSD Hackers Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Wed, 29 Sep 2004 12:04:30 +0000 Subject: FreeBSD 4.10 system stops responding 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, 29 Sep 2004 08:56:48 -0000 Hello, World! Opening a remote HTTP URL in raplayer (old a.out program) makes my FreeBSD 4.10-RELEASE box completely frozen. The system does not respond on PINGs. The same happens when I run raplayer in a remote X session. It looks like the trouble happens in the beginning of the prebuffering, before start of the playback. What is quite interesting is that when I entered "tuss raplayer >& /dev/console" the system did not get frozen. Can this be something timing/buffering related? Is there any way to investigate the problem without using NMI? Igor. From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 16:54: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 8804116A4CE for ; Wed, 29 Sep 2004 16:54:15 +0000 (GMT) Received: from intelli7.com (host350.jtan.com [207.106.6.174]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5403643D5D for ; Wed, 29 Sep 2004 16:54:15 +0000 (GMT) (envelope-from bcg@intelli7.com) Received: from [192.168.0.2] (unknown [65.222.158.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intelli7.com (Postfix) with ESMTP id 1FC7A7DC86A for ; Wed, 29 Sep 2004 12:58:29 -0400 (EDT) From: Brenden Grace To: freebsd-hackers@freebsd.org Content-Type: text/plain Message-Id: <1096476707.2670.1088.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 29 Sep 2004 12:51:47 -0400 Content-Transfer-Encoding: 7bit Subject: Device probe issue with an em(4) compatible device 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, 29 Sep 2004 16:54:15 -0000 I have a somewhat limited knowledge of FreeBSD's device system, so forgive (and correct) me if I get any of this wrong. I am writing a network driver for a em(4) compatible chip. I know the specific subvendor id and subdevice id, but the em(4) driver seems to attach to the device before my driver can. Is this because the em_probe is occurring before my probe AND because the em_probe is allowing for PCI_ANY_ID for subvendor subdevice ids (the vendor and device ids of my card are identical to an actual Intel card)? If so the solution then would be to have the em driver return a number less than zero in em_probe and my driver's probe to return a number greater than the em_probes's return? On a side not, would it also not be more correct for FreeBSD drivers in the tree to return a negative number for _any_ device that accepts a PCI_ANY_ID value? Thanks in advance for the clarification/help. -- Brenden C. Grace Intelli7 From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 17:01:32 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 434F116A4CE for ; Wed, 29 Sep 2004 17:01:32 +0000 (GMT) Received: from multiplay.co.uk (www1.multiplay.co.uk [212.42.16.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 851CB43D2D for ; Wed, 29 Sep 2004 17:01:31 +0000 (GMT) (envelope-from killing@multiplay.co.uk) Received: from vader ([212.135.219.179]) by multiplay.co.uk (multiplay.co.uk [212.42.16.7]) (MDaemon.PRO.v7.2.0.R) with ESMTP id md50000592255.msg for ; Wed, 29 Sep 2004 17:54:56 +0100 Message-ID: <010a01c4a645$e6356630$b3db87d4@multiplay.co.uk> From: "Steven Hartland" To: "Brenden Grace" , References: <1096476707.2670.1088.camel@localhost.localdomain> Date: Wed, 29 Sep 2004 18:00:58 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Spam-Processed: multiplay.co.uk, Wed, 29 Sep 2004 17:54:56 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 212.135.219.179 X-Return-Path: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-hackers@freebsd.org X-MDAV-Processed: multiplay.co.uk, Wed, 29 Sep 2004 17:54:59 +0100 Subject: Re: Device probe issue with an em(4) compatible device 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, 29 Sep 2004 17:01:32 -0000 If its compatible with em why not just alter the em to support the additional id's? Steve ----- Original Message ----- From: "Brenden Grace" > I am writing a network driver for a em(4) compatible chip. I know the > specific subvendor id and subdevice id, but the em(4) driver seems to > attach to the device before my driver can. Is this because the em_probe > is occurring before my probe AND because the em_probe is allowing for > PCI_ANY_ID for subvendor subdevice ids (the vendor and device ids of my > card are identical to an actual Intel card)? If so the solution then > would be to have the em driver return a number less than zero in > em_probe and my driver's probe to return a number greater than the > em_probes's return? > > On a side not, would it also not be more correct for FreeBSD drivers in > the tree to return a negative number for _any_ device that accepts a > PCI_ANY_ID value? ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone (023) 8024 3137 or return the E.mail to postmaster@multiplay.co.uk. From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 17:25: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 BB5AD16A4CE for ; Wed, 29 Sep 2004 17:25:00 +0000 (GMT) Received: from intelli7.com (host350.jtan.com [207.106.6.174]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9619243D2D for ; Wed, 29 Sep 2004 17:25:00 +0000 (GMT) (envelope-from bcg@intelli7.com) Received: from [192.168.0.2] (unknown [65.222.158.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intelli7.com (Postfix) with ESMTP id DA1AD7DC86A; Wed, 29 Sep 2004 13:29:14 -0400 (EDT) From: Brenden Grace To: freebsd-hackers@freebsd.org In-Reply-To: <010a01c4a645$e6356630$b3db87d4@multiplay.co.uk> References: <1096476707.2670.1088.camel@localhost.localdomain> <010a01c4a645$e6356630$b3db87d4@multiplay.co.uk> Content-Type: text/plain Message-Id: <1096478553.2670.1106.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 29 Sep 2004 13:22:33 -0400 Content-Transfer-Encoding: 7bit cc: Steven Hartland Subject: Re: Device probe issue with an em(4) compatible device 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, 29 Sep 2004 17:25:00 -0000 On Wed, 2004-09-29 at 13:00, Steven Hartland wrote: > If its compatible with em why not just alter the em to support > the additional id's? Because I don't need to ... Me: > > but the em(4) driver seems to attach to the device before my driver > > can. This card works fine with the em driver, but I want my driver to support the device not the em driver. -- Brenden C. Grace Intelli7 From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 19:20: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 EB1C816A4D0 for ; Wed, 29 Sep 2004 19:20:24 +0000 (GMT) Received: from intelli7.com (host350.jtan.com [207.106.6.174]) by mx1.FreeBSD.org (Postfix) with ESMTP id 800DC43D62 for ; Wed, 29 Sep 2004 19:20:22 +0000 (GMT) (envelope-from bcg@intelli7.com) Received: from [192.168.0.2] (unknown [65.222.158.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intelli7.com (Postfix) with ESMTP id 460567DC86A; Wed, 29 Sep 2004 15:24:34 -0400 (EDT) From: Brenden Grace To: freebsd-hackers@freebsd.org In-Reply-To: <415AF2D0.7090002@pantasys.com> References: <1096476707.2670.1088.camel@localhost.localdomain> <415AF2D0.7090002@pantasys.com> Content-Type: text/plain Message-Id: <1096485467.2670.1127.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 29 Sep 2004 15:17:47 -0400 Content-Transfer-Encoding: 7bit cc: Peter Buckingham Subject: Re: Device probe issue with an em(4) compatible device 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, 29 Sep 2004 19:20:25 -0000 On Wed, 2004-09-29 at 13:37, Peter Buckingham wrote: > why compile the em driver in at all? it won't probe the device if it > doesn't exist ;-) because I need it ... > otherwise, just add some code to the em's probe routine to check for > your subvendor, subdevice pair and exit without attaching. Well sure (though ugly), but I think having it just return a negative number would be a better fix than that. I was more interested in why the em driver (and others) returns 0 and ends the probing of a device that it could possibly only partially support (based on its matching of PCI_ANY_ID). If I understand DEVICE_PROBE(9) correctly it seems that the whole reason for the negative return scale is to avoid this very issue. -- Brenden C. Grace Intelli7 From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 19:50: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 17B8A16A4CE for ; Wed, 29 Sep 2004 19:50:43 +0000 (GMT) Received: from mailserv1.neuroflux.com (mailserv1.neuroflux.com [204.228.228.92]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91ED643D4C for ; Wed, 29 Sep 2004 19:50:42 +0000 (GMT) (envelope-from ryans@gamersimpact.com) Received: (qmail 4979 invoked by uid 89); 29 Sep 2004 19:57:39 -0000 Received: from unknown (HELO www2.neuroflux.com) (127.0.0.1) by localhost with SMTP; 29 Sep 2004 19:57:39 -0000 Received: from 208.4.77.15 (SquirrelMail authenticated user ryans@gamersimpact.com); by www2.neuroflux.com with HTTP; Wed, 29 Sep 2004 13:57:39 -0600 (MDT) Message-ID: <57735.208.4.77.15.1096487859.squirrel@208.4.77.15> Date: Wed, 29 Sep 2004 13:57:39 -0600 (MDT) From: "Ryan Sommers" To: hackers@freebsd.org User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal Subject: Serial Console / GDB Port 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, 29 Sep 2004 19:50:43 -0000 Is it possible to use the same serial line as the console and GDB port? I currently have console=comconsole in my loader.conf and am able to break to the debugger in tip. (I'm Ssh'ing into a box connected via serial line to the dev box.) I tried setting up gdb on that serial link. Broke into the debugger in one screen, opened gdb -k kernel.debug in another screen, when I typed in the target remote /dev/cuaa0 line in gdb though the garbage printed onto the serial line (beginning of the gdb protocol session I'm assuming) ended up crashing ddb and panicing the kernel and I'm unable to access the box over the serial line (and currently don't have physical access to the box). Now, I don't think I added the 0x80 flag onto the serial port. Will adding that flag fix this? Or is there something more I need to do to be able to enable gdb and a console on the same serial line? -- Ryan Sommers ryans@gamersimpact.com From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 19:54: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 AE03B16A4CE for ; Wed, 29 Sep 2004 19:54:48 +0000 (GMT) Received: from intelli7.com (host350.jtan.com [207.106.6.174]) by mx1.FreeBSD.org (Postfix) with ESMTP id 69E7943D39 for ; Wed, 29 Sep 2004 19:54:48 +0000 (GMT) (envelope-from bcg@intelli7.com) Received: from [192.168.0.2] (unknown [65.222.158.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by intelli7.com (Postfix) with ESMTP id 7B5F17DC86A; Wed, 29 Sep 2004 15:59:02 -0400 (EDT) From: Brenden Grace To: Peter Buckingham In-Reply-To: <415B0DDA.2040200@pantasys.com> References: <1096476707.2670.1088.camel@localhost.localdomain> <415AF2D0.7090002@pantasys.com> <1096485467.2670.1127.camel@localhost.localdomain> <415B0DDA.2040200@pantasys.com> Content-Type: text/plain Message-Id: <1096487538.2670.1147.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 29 Sep 2004 15:52:19 -0400 Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Device probe issue with an em(4) compatible device 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, 29 Sep 2004 19:54:48 -0000 On Wed, 2004-09-29 at 15:32, Peter Buckingham wrote: > experience then just not compiling in the em driver or an ugly like i > describe (or you suggest) should be fine. I wasn't trying to be rude, but DEVICE_PROBE(9) seems to describe how conflicts like this should be handled. I was wondering if I am in fact correct that devices that attempt to be generic enough for wide support (accepting PCI_ANY_ID) should also properly pass the probing (by returning some negative) so that a driver that may better fit the exact device can attach. > If you are doing it for the > later reason why aren't you just extending the em driver to support your > device? I _really_ am only interested in answers to the above question. -- Brenden C. Grace Intelli7 From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 00:00: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 9CBC916A4CE for ; Thu, 30 Sep 2004 00:00:54 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37B9C43D3F for ; Thu, 30 Sep 2004 00:00:54 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i8TNxNdo021911; Wed, 29 Sep 2004 17:59:23 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 29 Sep 2004 18:00:43 -0600 (MDT) Message-Id: <20040929.180043.128332638.imp@bsdimp.com> To: bcg@intelli7.com From: "M. Warner Losh" In-Reply-To: <1096476707.2670.1088.camel@localhost.localdomain> References: <1096476707.2670.1088.camel@localhost.localdomain> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: Device probe issue with an em(4) compatible device 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, 30 Sep 2004 00:00:54 -0000 In message: <1096476707.2670.1088.camel@localhost.localdomain> Brenden Grace writes: : I am writing a network driver for a em(4) compatible chip. I know the : specific subvendor id and subdevice id, but the em(4) driver seems to : attach to the device before my driver can. Is this because the em_probe : is occurring before my probe AND because the em_probe is allowing for : PCI_ANY_ID for subvendor subdevice ids (the vendor and device ids of my : card are identical to an actual Intel card)? If so the solution then : would be to have the em driver return a number less than zero in : em_probe and my driver's probe to return a number greater than the : em_probes's return? Ths solution is to have em's probe return a small negative number, and your probe return a larger negative number (eg, -10 for the em probe and -5 for yours). However, is there any reason you're writing a driver for a device that's compatible with em? why not use em? Warner From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 00:04:07 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 C10D116A4CF for ; Thu, 30 Sep 2004 00:04:07 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BDE243D39 for ; Thu, 30 Sep 2004 00:04:07 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i8U017Cr021973; Wed, 29 Sep 2004 18:01:07 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 29 Sep 2004 18:02:27 -0600 (MDT) Message-Id: <20040929.180227.22551443.imp@bsdimp.com> To: bcg@intelli7.com From: "M. Warner Losh" In-Reply-To: <1096485467.2670.1127.camel@localhost.localdomain> References: <1096476707.2670.1088.camel@localhost.localdomain> <415AF2D0.7090002@pantasys.com> <1096485467.2670.1127.camel@localhost.localdomain> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: peter@pantasys.com Subject: Re: Device probe issue with an em(4) compatible device 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, 30 Sep 2004 00:04:07 -0000 In message: <1096485467.2670.1127.camel@localhost.localdomain> Brenden Grace writes: : On Wed, 2004-09-29 at 13:37, Peter Buckingham wrote: : > why compile the em driver in at all? it won't probe the device if it : > doesn't exist ;-) : : because I need it ... As opposed to just hacking the em driver? : > otherwise, just add some code to the em's probe routine to check for : > your subvendor, subdevice pair and exit without attaching. : : Well sure (though ugly), but I think having it just return a negative : number would be a better fix than that. I was more interested in why the : em driver (and others) returns 0 and ends the probing of a device that : it could possibly only partially support (based on its matching of : PCI_ANY_ID). If I understand DEVICE_PROBE(9) correctly it seems that the : whole reason for the negative return scale is to avoid this very issue. That's correct. PCI_ANY_ID has nothing to do with it. If em_probe returns 0, it trumps all other drivers for that device that haven't had a chance to bid (as well as the potential drivers that bid a negative number). Warner From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 00:06: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 E828716A4CE for ; Thu, 30 Sep 2004 00:06:58 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AB1043D2D for ; Thu, 30 Sep 2004 00:06:58 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i8U05ZC5022039; Wed, 29 Sep 2004 18:05:35 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 29 Sep 2004 18:06:55 -0600 (MDT) Message-Id: <20040929.180655.29463294.imp@bsdimp.com> To: bcg@intelli7.com From: "M. Warner Losh" In-Reply-To: <1096487538.2670.1147.camel@localhost.localdomain> References: <1096485467.2670.1127.camel@localhost.localdomain> <415B0DDA.2040200@pantasys.com> <1096487538.2670.1147.camel@localhost.localdomain> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org cc: peter@pantasys.com Subject: Re: Device probe issue with an em(4) compatible device 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, 30 Sep 2004 00:06:59 -0000 In message: <1096487538.2670.1147.camel@localhost.localdomain> Brenden Grace writes: : On Wed, 2004-09-29 at 15:32, Peter Buckingham wrote: : > experience then just not compiling in the em driver or an ugly like i : > describe (or you suggest) should be fine. : : I wasn't trying to be rude, but DEVICE_PROBE(9) seems to describe how : conflicts like this should be handled. I was wondering if I am in fact : correct that devices that attempt to be generic enough for wide support : (accepting PCI_ANY_ID) should also properly pass the probing (by : returning some negative) so that a driver that may better fit the exact : device can attach. Well, it does match on the VENDOR ID and DEVICE, so it isn't that generic. The subvendor field is generally a don't care field for drivers in FreeBSD, so it is just following existing practices. Maybe that practice should be revisited, but that's why em_probe does things the way it does. If you need em to not attach, you'll have to hack em in your tree to return some small negative number. Chances are excellent that FreeBSD 6 will have facilities to address these issues (they are needed both for 'vendor supplied updated drivers' as well as 'please load me when you see this sort of card'). Warner From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 10:29: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 D851C16A4CE for ; Thu, 30 Sep 2004 10:29:09 +0000 (GMT) Received: from lara.cc.fer.hr (lara.cc.fer.hr [161.53.72.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id 094C243D2D for ; Thu, 30 Sep 2004 10:29:07 +0000 (GMT) (envelope-from ivoras@fer.hr) Received: from [127.0.0.1] (localhost.cc.fer.hr [127.0.0.1]) by lara.cc.fer.hr (8.13.1/8.13.1) with ESMTP id i8UASIZG068086 for ; Thu, 30 Sep 2004 12:28:19 +0200 (CEST) (envelope-from ivoras@fer.hr) Message-ID: <415BDFC2.1020304@fer.hr> Date: Thu, 30 Sep 2004 12:28:18 +0200 From: Ivan Voras User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: hackers@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: GEOM (ggate) compression consumer +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: Thu, 30 Sep 2004 10:29:10 -0000 I've made a GEOM compression layer daemon for ggate (compresses data before storing to underlying file/media). It's still early version and unfinished, and it's available at: http://ivoras.sharanet.org/ggcomp.tgz (caveat: don't overflow it; e.g. storing 50MB from /dev/zero onto a device backed by a 10MB file is fine (with -c5 switch), but doing the same with /dev/random is not (risk of kernel panic)) I know it supports building (and using) an UFS[2] filesystem in it, I haven't tried others (It registers as a device with 8k sectors; it seems it's the maximum UFS can handle, although the compression would be more efficient with larger sector sizes). It's really good at making backups of /dev/zero :) Now the problem: I currently only tested this on an old kernel (5.2-CURRENT from a few months ago), so this might be fixed in newer versions, but when I stress it with writing large files, the system 'hangs' with my process (ggcomp) in 'wdrain' state. I'm not doing anything extraordinary (except that compression takes time...) in it, so I don't think it's "my fault". Any ideas? From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 29 19:33:05 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 AA7F716A4CE for ; Wed, 29 Sep 2004 19:33:05 +0000 (GMT) Received: from hotmail.com (bay13-f17.bay13.hotmail.com [64.4.31.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8DBAF43D2D for ; Wed, 29 Sep 2004 19:33:05 +0000 (GMT) (envelope-from vijju_s@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 29 Sep 2004 12:33:02 -0700 Received: from 206.132.194.2 by by13fd.bay13.hotmail.msn.com with HTTP; Wed, 29 Sep 2004 19:32:53 GMT X-Originating-IP: [206.132.194.2] X-Originating-Email: [vijju_s@hotmail.com] X-Sender: vijju_s@hotmail.com From: "vijay singh" To: freebsd-hackers@freebsd.org Date: Wed, 29 Sep 2004 12:32:53 -0700 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 29 Sep 2004 19:33:02.0595 (UTC) FILETIME=[2299B530:01C4A65B] X-Mailman-Approved-At: Thu, 30 Sep 2004 12:24:54 +0000 Subject: about freebsd boot1.S 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, 29 Sep 2004 19:33:05 -0000 hello all, i am trying to understand the freebsd boot code. i saw that the 1st stage boot loader relocates itself from 7c00 to 700. why is this done? if the run time kernel were to switch to real-mode and transfer control to this location (0700) would the 1st stage boot program run again? for the output below, i used the BIOS debugger and read the 1st sector into 7c00, and unassebled the text. 0000:00007C1D cld 0000:00007C1E xor cx, cx /* cx = 0 */ 0000:00007C20 mov es, cx /* es = 0 */ 0000:00007C22 mov ds, cx /* ds = 0 */ 0000:00007C24 mov ss, cx /* ss = 0 */ 0000:00007C26 mov sp, 7C00 /* set SP to current location */ 0000:00007C29 mov si, sp 0000:00007C2B mov di, 0700 /* DS:SI pair denotes the source string and ES:DI pair the destination string 0:7C00 -> 0:700 */ 0000:00007C2E inc ch /* ch = 1, cx = 100*/ 0000:00007C30 repe /* repeat the movsw instruction cx number of times */ 0000:00007C31 movsw /* moves 200h = 512 bytes from 7C00 to 700*/ please cc me in your reply. thanks vijay From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 17:35: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 4E4F216A4CE for ; Thu, 30 Sep 2004 17:35:38 +0000 (GMT) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id DAECC43D2D for ; Thu, 30 Sep 2004 17:35:35 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 18026 invoked from network); 30 Sep 2004 17:35:35 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 30 Sep 2004 17:35:35 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i8UHZREj019616; Thu, 30 Sep 2004 13:35:31 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-hackers@FreeBSD.org Date: Thu, 30 Sep 2004 10:34:28 -0400 User-Agent: KMail/1.6.2 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409301034.28349.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: vijay singh Subject: Re: about freebsd boot1.S 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, 30 Sep 2004 17:35:38 -0000 On Wednesday 29 September 2004 03:32 pm, vijay singh wrote: > hello all, i am trying to understand the freebsd boot code. i saw that the > 1st stage boot loader relocates itself from 7c00 to 700. why is this done? > if the run time kernel were to switch to real-mode and transfer control to > this location (0700) would the 1st stage boot program run again? > > for the output below, i used the BIOS debugger and read the 1st sector into > 7c00, and unassebled the text. > > 0000:00007C1D cld > 0000:00007C1E xor cx, cx /* cx = 0 */ > 0000:00007C20 mov es, cx /* es = 0 */ > 0000:00007C22 mov ds, cx /* ds = 0 */ > 0000:00007C24 mov ss, cx /* ss = 0 */ > 0000:00007C26 mov sp, 7C00 /* set SP to current location */ > 0000:00007C29 mov si, sp > 0000:00007C2B mov di, 0700 /* DS:SI pair denotes the source string > and ES:DI pair the destination string 0:7C00 -> 0:700 */ > 0000:00007C2E inc ch /* ch = 1, cx = 100*/ > 0000:00007C30 repe /* repeat the movsw instruction cx number of times */ > 0000:00007C31 movsw /* moves 200h = 512 bytes from 7C00 to 700*/ > > please cc me in your reply. We copy ourselves down so that we can use 0x7c00 as a buffer to load sectors into off of the disk. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 23:40: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 A7B0416A4CE for ; Thu, 30 Sep 2004 23:40:29 +0000 (GMT) Received: from smtp.uol.com.br (smtpout3.uol.com.br [200.221.11.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4F6643D75 for ; Thu, 30 Sep 2004 23:40:18 +0000 (GMT) (envelope-from jonny@jonny.eng.br) Received: from [200.217.177.121] (unknown [200.217.177.121]) by scorpion3.uol.com.br (Postfix) with ESMTP id 757FAD67B; Thu, 30 Sep 2004 20:40:04 -0300 (BRT) Message-ID: <415C9967.3090309@jonny.eng.br> Date: Thu, 30 Sep 2004 20:40:23 -0300 From: =?ISO-8859-1?Q?Jo=E3o_Carlos_Mendes_Lu=EDs?= User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ivan Voras , hackers@freebsd.org References: <415BDFC2.1020304@fer.hr> In-Reply-To: <415BDFC2.1020304@fer.hr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: GEOM (ggate) compression consumer +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: Thu, 30 Sep 2004 23:40:30 -0000 Instead of block compression, wouldn't it be better (and maybe easier) to use file compresion, in a VFS layer (and a threaded daemon)? A real useful VFS layer would have an option to compress only rarely used files. And keep the real layer accessible, to allow dumping of compressed backend files. Also, an option to encrypt the backend files could be useful. Encrypting after compressing is always better. This is what I would like to see in a compressed file system. Ivan Voras wrote: > I've made a GEOM compression layer daemon for ggate (compresses data > before storing to underlying file/media). It's still early version and > unfinished, and it's available at: > > http://ivoras.sharanet.org/ggcomp.tgz > > (caveat: don't overflow it; e.g. storing 50MB from /dev/zero onto a > device backed by a 10MB file is fine (with -c5 switch), but doing the > same with /dev/random is not (risk of kernel panic)) > > I know it supports building (and using) an UFS[2] filesystem in it, I > haven't tried others (It registers as a device with 8k sectors; it seems > it's the maximum UFS can handle, although the compression would be more > efficient with larger sector sizes). It's really good at making backups > of /dev/zero :) > > Now the problem: I currently only tested this on an old kernel > (5.2-CURRENT from a few months ago), so this might be fixed in newer > versions, but when I stress it with writing large files, the system > 'hangs' with my process (ggcomp) in 'wdrain' state. I'm not doing > anything extraordinary (except that compression takes time...) in it, so > I don't think it's "my fault". Any ideas? > > _______________________________________________ > 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" Jonny -- João Carlos Mendes Luís - Networking Engineer - jonny@jonny.eng.br From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 1 01:42: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 3A84316A4CE for ; Fri, 1 Oct 2004 01:42:24 +0000 (GMT) Received: from afields.ca (afields.ca [216.194.67.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id E37C143D1F for ; Fri, 1 Oct 2004 01:42:23 +0000 (GMT) (envelope-from afields@afields.ca) Received: from afields.ca (localhost.afields.ca [127.0.0.1]) by afields.ca (8.12.11/8.12.11) with ESMTP id i911gEC5022912; Thu, 30 Sep 2004 21:42:14 -0400 (EDT) (envelope-from afields@afields.ca) Received: (from afields@localhost) by afields.ca (8.12.11/8.12.11/Submit) id i911gEMD022911; Thu, 30 Sep 2004 21:42:14 -0400 (EDT) (envelope-from afields) Date: Thu, 30 Sep 2004 21:42:13 -0400 From: Allan Fields To: Jo?o Carlos Mendes Lu?s Message-ID: <20041001014213.GN47410@afields.ca> References: <415BDFC2.1020304@fer.hr> <415C9967.3090309@jonny.eng.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <415C9967.3090309@jonny.eng.br> User-Agent: Mutt/1.4i cc: hackers@freebsd.org cc: Ivan Voras Subject: Re: GEOM (ggate) compression consumer +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: Fri, 01 Oct 2004 01:42:24 -0000 The funny thing is you'll run into lots of these types of similarities in solutions between the two levels (at the VFS and at the device level). The parallel solutions may differ significantly in implementation, but are layer-wise homologies (analogs). You can do compression and encryption at multiple levels in the system w/ various benefits and disadvantages. Data can pass through any of these layers on it's way to disk or over the network as the case might be. On Thu, Sep 30, 2004 at 08:40:23PM -0300, Jo?o Carlos Mendes Lu?s wrote: > Instead of block compression, wouldn't it be better (and maybe easier) > to use file compresion, in a VFS layer (and a threaded daemon)? No need to have a user-side daemon if the compression/encryption logic is implemented on the kernel side. Else you may run into bottlenecks and other implementation issues. One alternative is to implement a VFS infrastructure like DragonFly has planned to allow user-side filesystems to become practical. There are arguments about why each approach should be used. > A real useful VFS layer would have an option to compress only rarely > used files. And keep the real layer accessible, to allow dumping of > compressed backend files. > > Also, an option to encrypt the backend files could be useful. > Encrypting after compressing is always better. You're referring to capabilities that FiST (http://www.filesystems.org) can offer. Support for FreeBSD SCA isn't yet complete which is required to get compression (gzipfs) to work. > This is what I would like to see in a compressed file system. While the granularity of operation is reduced to the file level by sticking with a VFS layer implementation, it can be more complicated than device level compression/encryption at this point and there are a few issues remaining to be solved. > Ivan Voras wrote: > >I've made a GEOM compression layer daemon for ggate (compresses data > >before storing to underlying file/media). It's still early version and > >unfinished, and it's available at: > > > >http://ivoras.sharanet.org/ggcomp.tgz > > Jonny > > -- > Jo?o Carlos Mendes Lu?s - Networking Engineer - jonny@jonny.eng.br -- Allan Fields, AFRSL - http://afields.ca 2D4F 6806 D307 0889 6125 C31D F745 0D72 39B4 5541 From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 1 06:31: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 8885316A4CE for ; Fri, 1 Oct 2004 06:31:26 +0000 (GMT) Received: from ketralnis.dyndns.org (adsl-64-173-8-101.dsl.sntc01.pacbell.net [64.173.8.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23B5943D2D for ; Fri, 1 Oct 2004 06:31:26 +0000 (GMT) (envelope-from ketralnis@ketralnis.dyndns.org) Received: from ketralnis.dyndns.org (localhost [127.0.0.1]) by ketralnis.dyndns.org (8.12.10/8.12.10) with ESMTP id i916V7JQ072267 for ; Thu, 30 Sep 2004 23:31:07 -0700 (PDT) (envelope-from ketralnis@ketralnis.dyndns.org) Received: from localhost (ketralnis@localhost)i916V2vq072264 for ; Thu, 30 Sep 2004 23:31:02 -0700 (PDT) (envelope-from ketralnis@ketralnis.dyndns.org) Date: Thu, 30 Sep 2004 23:31:02 -0700 (PDT) From: David King To: hackers@freebsd.org In-Reply-To: <415C9967.3090309@jonny.eng.br> Message-ID: <20040930231326.A72233@ketralnis.dyndns.org> References: <415BDFC2.1020304@fer.hr> <415C9967.3090309@jonny.eng.br> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: GEOM (ggate) compression consumer +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: Fri, 01 Oct 2004 06:31:26 -0000 > Instead of block compression, wouldn't it be better (and maybe easier) to use > file compresion, in a VFS layer (and a threaded daemon)? > > A real useful VFS layer would have an option to compress only rarely used > files. And keep the real layer accessible, to allow dumping of compressed > backend files. Something I've always wanted to be able to do, and have never found a "pretty" way, is to attach an action to reads and writes of a file. For instance, I have a file called foo. foo is really a front-end for a background file called ".foo.gz". Reading from foo gives you the output of "gzip -d < foo.gz" and writing to the file really directs that output to "gzip -c > foo.gz" This would be especially useful in compression scenarios like this, encryption, creating dynamic playlists, etc. Rarely accessed programs could be stored as source and compiled once in a blue moon to be run and discarded. Maybe I prefer LaTeX to HTML: a dynamic file could translate my LaTeX back and forth HTML on read and write My present solution is a set of programs I call "dynfiled" (dynamic file daemon) that really just sits on a select() call and waits for reads and writes to some named pipes it creates. This has some obvious drawbacks in that not all programs read and write in a pipe-friendly manner. A quick-hack-like way would be to add a link to two binary's inodes to the "dynamic" file's inode (one for read, one for write). This has the downside of limiting the command to a single binary that would have to check argv[0], and force it to be on the same file system (although a union over the top of the two FS's would be an (undesirable) fix), but I suppose it'd work. The speed consequences in my implementation are dramatic, but I don't much see a way around it, since passing something from disk is far faster than passing it from disk, doing and operation on it, then passing it up. /That/ is something I'd like to see in a VFS layer :) From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 1 10:17: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 5EB8816A4CE for ; Fri, 1 Oct 2004 10:17:22 +0000 (GMT) Received: from lara.cc.fer.hr (lara.cc.fer.hr [161.53.72.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id B6F6F43D2D for ; Fri, 1 Oct 2004 10:17:21 +0000 (GMT) (envelope-from ivoras@fer.hr) Received: from [127.0.0.1] (localhost.cc.fer.hr [127.0.0.1]) by lara.cc.fer.hr (8.13.1/8.13.1) with ESMTP id i91AGcff010680 for ; Fri, 1 Oct 2004 12:16:39 +0200 (CEST) (envelope-from ivoras@fer.hr) Message-ID: <415D2E86.5060007@fer.hr> Date: Fri, 01 Oct 2004 12:16:38 +0200 From: Ivan Voras User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: hackers@freebsd.org References: <415BDFC2.1020304@fer.hr> <415C9967.3090309@jonny.eng.br> In-Reply-To: <415C9967.3090309@jonny.eng.br> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: GEOM (ggate) compression consumer +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: Fri, 01 Oct 2004 10:17:22 -0000 João Carlos Mendes Luís wrote: > Instead of block compression, wouldn't it be better (and maybe easier) > to use file compresion, in a VFS layer (and a threaded daemon)? Better, yes. Easier very much not, since I know something about GEOM (actually, ggate), and nothing about VFS and kernel internals. Also, as others mentioned, even files would need to be compressed in blocks, to allow for random seeking... > This is what I would like to see in a compressed file system. I agree :) But, I still can't solve the wdrain problem. I've tried it on a recent BETA6 kernel and it still remains. Writes get slower and slower (actually, the frequency of writes), and then something locks up (with no CPU usage...). Sometimes, *any* writes to any filesystem lock up. Should I take it to geom@ list? It doesn't seem to be developer-oriented. From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 14:03: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 B971716A4FA for ; Thu, 30 Sep 2004 14:03:02 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 13A8343D70 for ; Thu, 30 Sep 2004 14:03:02 +0000 (GMT) (envelope-from durham@jcdurham.com) Received: from tiltdown.pgh.nepinc.com (pgh.nepinc.com [66.207.129.50]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i8UE31rH004083 for ; Thu, 30 Sep 2004 10:03:01 -0400 (EDT) (envelope-from durham@jcdurham.com) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Thu, 30 Sep 2004 10:03:00 -0400 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200409301003.00492.durham@jcdurham.com> X-Mailman-Approved-At: Fri, 01 Oct 2004 12:33:05 +0000 Subject: Sudden Reboots 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, 30 Sep 2004 14:03:02 -0000 I have had this problem now with at least 3 FreeBSD servers over a period of about 2 years. I had put it down to some hardware problem but it seems to be too much of a coincidence with 3 different machines doing the same thing. The first time was when I put 4.5-RELEASE on a brand new Dell Poweredge 2650. I ran it on the bench for a week or so, then decided all was well and put it in the server rack and started doing the company's email service on it. After a few weeks, it suddenly would 'reboot' for no apparent reason. No log entries, nothing at all except the usual stuff in /var/log/messages about '/ was not unmounted correctly', etc. Just like you had pulled the power plug. The 2nd instance was a server that I maintain for an ISP that was a mirror image of their primary server, a 'hot spare' so to speak. The primary, running the same software was solid, but the backup would reboot at about 5:20 every morning with the same syndrome..no log entries of any sort and just the usual entries in /var/log messages saying the the / partition was not unmounted properly. The odd thing was that it was happening at virtually the same time every morning. I upgraded both systems to the latest -RELEASE and it made no difference. Then, they both just *stopped doing it by themselves* with no apparent correlation to anything installed software-wise. Neither server has had any problem for over a year now. The 3rd instance is happening now. Another server I maintain for my 'night job' is doing the same thing for a customer. It just 'stops' like you pulled the power plug. However, this time I thought to check using 'last' and found that I had accidentally left an ssh session open and that entry said 'crash'. There are no other log entries I can find related to the 'reboot'. I 'googled' this problem and found it mentioned at least dozens of times without any answer brought forth. I'm beginning to think this is real, but so intermittent that I don't know how to begin to debug or find it. A wild guess would be something like an unitialized pointer, where everything works until whereever it is pointing to assumes some value that makes it just die suddenly without even a panic message. The reason that I suspect this is also that the server that is doing this currently was running fine for a year, then the floods we had recently caused it to be powered down for a day or so and usually it is on a UPS and never is powered down, so that would have maybe changed the 'garbage' in memory, whereas normally it would stay the same until it was powered down. IE; if an uninitialized pointer was the culprit, maybe what it is pointing to, or where it is pointing is critical and powering it down changes where it is pointing and that area gets overwritten by some system process and causes the reboot. I'm posting this to 'hackers' because I thought it might be a kernel thing. -- -Jim From owner-freebsd-hackers@FreeBSD.ORG Thu Sep 30 15:10: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 1657516A4CE; Thu, 30 Sep 2004 15:10:42 +0000 (GMT) Received: from marlena.vvi.at (marlena.vvi.at [208.252.225.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB30F43D3F; Thu, 30 Sep 2004 15:10:41 +0000 (GMT) (envelope-from www@marlena.vvi.at) Received: from marlena.vvi.at (localhost.marlena.vvi.at [127.0.0.1]) by marlena.vvi.at (8.12.10/8.12.9) with ESMTP id i8U8ECb8065375; Thu, 30 Sep 2004 01:14:12 -0700 (PDT) (envelope-from www@marlena.vvi.at) Received: (from www@localhost) by marlena.vvi.at (8.12.10/8.12.10/Submit) id i8U8EB1u065374; Thu, 30 Sep 2004 01:14:11 -0700 (PDT) (envelope-from www) Date: Thu, 30 Sep 2004 01:14:11 -0700 (PDT) Message-Id: <200409300814.i8U8EB1u065374@marlena.vvi.at> To: freebsd-mobile@freebsd.org From: "ALeine" X-Mailman-Approved-At: Fri, 01 Oct 2004 12:33:05 +0000 cc: freebsd-hackers@freebsd.org Subject: Sigmatel USB IrDA dongle 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, 30 Sep 2004 15:10:42 -0000 Hi, I'd like to use the SigmaTel USB IrDA dongle to connect my computer (FreeBSD 4.10-STABLE) and my mobile phone (Samsung X600). According to my log, the dongle is recognized: /kernel: ugen0: Sigmatel Inc IrDA/USB Bridge, rev 1.10/0.08, addr 2 So what do I do now? I've searched everywhere and there seems to be no software I can use with the dongle (birda, lirc, gnokii all support only serial IrDA dongles at best). Is anyone working on something to make use of USB IrDA dongles on FreeBSD? If not, does anyone have some sort of alternative solution? Some Linux mini distribution with irda-tools running inside bochs or VMware? I installed VMware 3.2 from the ports because it is supposed to now support mapping of USB devices, but since it is a native Linux application it would need a true, mapped usbdevfs under /compat/linux/proc/bus/usb to actually work. Is anyone working on this? I know that almost exactly two years ago Bruce M Simpson posted on freebsd-hackers about this issue, but I have no info on what has been done. Any info will be greatly appreciated, I'm interested in making this work even if I have to spend a few months coding everything myself. Thanks & best regards, ALeine ___________________________________________________________________ WebMail FREE http://mail.austrosearch.net From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 1 14:32: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 BFBF316A4CE; Fri, 1 Oct 2004 14:32:26 +0000 (GMT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 456BA43D41; Fri, 1 Oct 2004 14:32:26 +0000 (GMT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.11/8.12.11) id i91EWH4j038913; Fri, 1 Oct 2004 09:32:17 -0500 (CDT) (envelope-from dan) Date: Fri, 1 Oct 2004 09:32:17 -0500 From: Dan Nelson To: ALeine Message-ID: <20041001143216.GI22530@dan.emsphone.com> References: <200409300814.i8U8EB1u065374@marlena.vvi.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200409300814.i8U8EB1u065374@marlena.vvi.at> X-OS: FreeBSD 5.3-BETA5 X-message-flag: Outlook Error User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org cc: freebsd-mobile@freebsd.org Subject: Re: Sigmatel USB IrDA dongle 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, 01 Oct 2004 14:32:26 -0000 In the last episode (Sep 30), ALeine said: > I'd like to use the SigmaTel USB IrDA dongle to connect my computer > (FreeBSD 4.10-STABLE) and my mobile phone (Samsung X600). According > to my log, the dongle is recognized: > > /kernel: ugen0: Sigmatel Inc IrDA/USB Bridge, rev 1.10/0.08, addr 2 > > So what do I do now? I've searched everywhere and there seems to be > no software I can use with the dongle (birda, lirc, gnokii all > support only serial IrDA dongles at best). Is anyone working on > something to make use of USB IrDA dongles on FreeBSD? You may have to wait for someone to port the irframe and ustir devices from NetBSD: http://netbsd.gw.com/cgi-bin/man-cgi?ustir http://netbsd.gw.com/cgi-bin/man-cgi?irframe > Any info will be greatly appreciated, I'm interested in making > this work even if I have to spend a few months coding everything > myself. If you're a programmer, you might want to see if porting them yourself is an option. I think a lot of our USB support comes from NetBSD already. -- Dan Nelson dnelson@allantgroup.com From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 1 16:36: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 86B9516A4CE for ; Fri, 1 Oct 2004 16:36:35 +0000 (GMT) Received: from mail.ambrisko.com (adsl-64-174-51-43.dsl.snfc21.pacbell.net [64.174.51.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 449EB43D53 for ; Fri, 1 Oct 2004 16:36:35 +0000 (GMT) (envelope-from ambrisko@ambrisko.com) Received: from server2.ambrisko.com (HELO www.ambrisko.com) (192.168.1.2) by mail.ambrisko.com with ESMTP; 01 Oct 2004 09:36:35 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.12.9p2/8.12.9) with ESMTP id i91GaYkT093429; Fri, 1 Oct 2004 09:36:34 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.12.9p2/8.12.9/Submit) id i91GaYgC093428; Fri, 1 Oct 2004 09:36:34 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200410011636.i91GaYgC093428@ambrisko.com> In-Reply-To: <200409301003.00492.durham@jcdurham.com> To: Jim Durham Date: Fri, 1 Oct 2004 09:36:34 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots 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, 01 Oct 2004 16:36:35 -0000 Jim Durham writes: | I have had this problem now with at least 3 FreeBSD servers over a period of | about 2 years. I had put it down to some hardware problem but it seems to be | too much of a coincidence with 3 different machines doing the same thing. | | The first time was when I put 4.5-RELEASE on a brand new Dell Poweredge 2650. | I ran it on the bench for a week or so, then decided all was well and put it | in the server rack and started doing the company's email service on it. After | a few weeks, it suddenly would 'reboot' for no apparent reason. No log | entries, nothing at all except the usual stuff in /var/log/messages about '/ | was not unmounted correctly', etc. Just like you had pulled the power plug. How much memory are in these system?. If you have 3G or more you end up with very little left for the kernel in the 2G space. You can monitor how much space you have left by compile a debug kernel then as root: gdb -k kernel.debug /dev/mem print ((unsigned int)virtual_end)-((unsigned int)kernel_vm_end) This should probably be made into a sysctl so it can be montored better. If you only have a few meg. left it doesn't take many processes to fork etc. then you machine blows up. The bge driver for example takes 4M each for the jumbo packet handling. You can recover some of this memory via loader.conf tunables or bump KVA_PAGES in your kernel config file. Still once this memory is put into the zone allocator (vmstat -z) in -stable it is gone from the system even if that bucket isn't fully used or needed :-( Ironically the more memory you put in a system the less you can do with the system! A lot of people are starting to run into this problem since large memory machines are cheap. Doug A. From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 1 18:06: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 1655A16A4CE for ; Fri, 1 Oct 2004 18:06:57 +0000 (GMT) Received: from beck.quonix.net (beck.quonix.net [146.145.66.90]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7788743D41 for ; Fri, 1 Oct 2004 18:06:56 +0000 (GMT) (envelope-from john@essenz.com) Received: from [192.168.1.100] (pool-141-158-247-68.phil.east.verizon.net [141.158.247.68]) by beck.quonix.net (8.12.11/8.12.11) with ESMTP id i91I6sqY075670 for ; Fri, 1 Oct 2004 14:06:54 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v619) In-Reply-To: <200410011636.i91GaYgC093428@ambrisko.com> References: <200410011636.i91GaYgC093428@ambrisko.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6F869D9B-13D3-11D9-ADF0-0003933DDCFA@essenz.com> Content-Transfer-Encoding: 7bit From: John Von Essen Date: Fri, 1 Oct 2004 13:58:01 -0400 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.619) X-SpamAssassin-2.64-Score: 0.5/6 RCVD_IN_NJABL_DUL,RCVD_IN_SORBS_DUL X-MimeDefang-2.44: beck.quonix.net X-Scanned-By: MIMEDefang 2.44 Subject: Re: Sudden Reboots 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, 01 Oct 2004 18:06:57 -0000 Could there be some more elaboration on these memory issues. From the way you described it, it sounds like if you have two machines serving the same function with the same load, and one machine has 512Mb and the other has 2.5Gb, the one with more memory might be prone to be more problems. Why is that? How do you tune the kernel to get around this? -John On Oct 1, 2004, at 12:36 PM, Doug Ambrisko wrote: > How much memory are in these system?. If you have 3G or more you end > up with very little left for the kernel in the 2G space. You can > monitor how much space you have left by compile a debug kernel then > as root: > gdb -k kernel.debug /dev/mem > print ((unsigned int)virtual_end)-((unsigned int)kernel_vm_end) > This should probably be made into a sysctl so it can be montored > better. > > If you only have a few meg. left it doesn't take many processes to > fork etc. then you machine blows up. The bge driver for example takes > 4M each for the jumbo packet handling. You can recover some of this > memory via loader.conf tunables or bump KVA_PAGES in your kernel > config file. Still once this memory is put into the zone allocator > (vmstat -z) in -stable it is gone from the system even if that bucket > isn't fully used or needed :-( > > Ironically the more memory you put in a system the less you can do with > the system! > > A lot of people are starting to run into this problem since large > memory > machines are cheap. > > Doug A. From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 1 22:37:20 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 6AE8C16A4CE for ; Fri, 1 Oct 2004 22:37:20 +0000 (GMT) Received: from obsecurity.dyndns.org (CPE0050040655c8-CM00111ae02aac.cpe.net.cable.rogers.com [69.194.102.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35E3043D48 for ; Fri, 1 Oct 2004 22:37:20 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id A925451491; Fri, 1 Oct 2004 15:38:02 -0700 (PDT) Date: Fri, 1 Oct 2004 15:38:02 -0700 From: Kris Kennaway To: Jim Durham Message-ID: <20041001223802.GA90717@xor.obsecurity.org> References: <200409301003.00492.durham@jcdurham.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <200409301003.00492.durham@jcdurham.com> User-Agent: Mutt/1.4.2.1i cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots 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, 01 Oct 2004 22:37:20 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 30, 2004 at 10:03:00AM -0400, Jim Durham wrote: > I have had this problem now with at least 3 FreeBSD servers over a period= of=20 > about 2 years. I had put it down to some hardware problem but it seems to= be=20 > too much of a coincidence with 3 different machines doing the same thing. >=20 > The first time was when I put 4.5-RELEASE on a brand new Dell Poweredge 2= 650.=20 > I ran it on the bench for a week or so, then decided all was well and put= it=20 > in the server rack and started doing the company's email service on it. A= fter=20 > a few weeks, it suddenly would 'reboot' for no apparent reason. No log=20 > entries, nothing at all except the usual stuff in /var/log/messages about= '/=20 > was not unmounted correctly', etc. Just like you had pulled the power plu= g. >=20 > The 2nd instance was a server that I maintain for an ISP that was a mirro= r=20 > image of their primary server, a 'hot spare' so to speak. The primary,=20 > running the same software was solid, but the backup would reboot at about= =20 > 5:20 every morning with the same syndrome..no log entries of any sort and= =20 > just the usual entries in /var/log messages saying the the / partition wa= s=20 > not unmounted properly. The odd thing was that it was happening at virtua= lly=20 > the same time every morning. >=20 > I upgraded both systems to the latest -RELEASE and it made no difference= .=20 > Then, they both just *stopped doing it by themselves* with no apparent=20 > correlation to anything installed software-wise. Neither server has had a= ny=20 > problem for over a year now. >=20 > The 3rd instance is happening now. Another server I maintain for my 'nigh= t=20 > job' is doing the same thing for a customer. It just 'stops' like you pul= led=20 > the power plug. However, this time I thought to check using 'last' and fo= und=20 > that I had accidentally left an ssh session open and that entry said 'cra= sh'. > There are no other log entries I can find related to the 'reboot'. Do you have ddb enabled? If not, the machine may be panicking and rebooting automatically. Actual "spontaneous reboots" are very rare and usually caused by hardware problems (e.g. faulty power supply, overheating CPU, bad RAM). Enable DDB, and see what happens the next time it crashes. Kris --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXdxKWry0BWjoQKURAm2DAKDdJ+3xVm+va9FFU4aF3qG4ei63JACbBo0P 4BOY0sXAW0l8qdg++c9l22E= =Clj9 -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 00:16: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 5B5B216A4CE for ; Sat, 2 Oct 2004 00:16:55 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id C073A43D3F for ; Sat, 2 Oct 2004 00:16:54 +0000 (GMT) (envelope-from durham@jcdurham.com) Received: from dhcp13.home.jcdurham.com (dhcp13.home.jcdurham.com [192.168.5.13]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i920GqXp077233; Fri, 1 Oct 2004 20:16:52 -0400 (EDT) (envelope-from durham@jcdurham.com) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Fri, 1 Oct 2004 20:16:51 -0400 User-Agent: KMail/1.7 References: <200410011636.i91GaYgC093428@ambrisko.com> In-Reply-To: <200410011636.i91GaYgC093428@ambrisko.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410012016.51415.durham@jcdurham.com> Subject: Re: Sudden Reboots 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, 02 Oct 2004 00:16:55 -0000 On Friday 01 October 2004 12:36 pm, Doug Ambrisko wrote: > Jim Durham writes: > | I have had this problem now with at least 3 FreeBSD servers over a period > | of about 2 years. I had put it down to some hardware problem but it seems > | to be too much of a coincidence with 3 different machines doing the same > | thing. > | > | The first time was when I put 4.5-RELEASE on a brand new Dell Poweredge > | 2650. I ran it on the bench for a week or so, then decided all was well > | and put it in the server rack and started doing the company's email > | service on it. After a few weeks, it suddenly would 'reboot' for no > | apparent reason. No log entries, nothing at all except the usual stuff in > | /var/log/messages about '/ was not unmounted correctly', etc. Just like > | you had pulled the power plug. > > How much memory are in these system?. The Dell is a Dual Xeon 2650 with 2gb or Ram. The ISP's box has only 256 megs or ram and the business customer's box has 512. > If you have 3G or more you end > up with very little left for the kernel in the 2G space Can you elaborate on why this is? > . You can > monitor how much space you have left by compile a debug kernel then > as root: > gdb -k kernel.debug /dev/mem > print ((unsigned int)virtual_end)-((unsigned int)kernel_vm_end) > This should probably be made into a sysctl so it can be montored > better. > > If you only have a few meg. left it doesn't take many processes to > fork etc. then you machine blows up. The bge driver for example takes > 4M each for the jumbo packet handling. You can recover some of this > memory via loader.conf tunables or bump KVA_PAGES in your kernel > config file. Still once this memory is put into the zone allocator > (vmstat -z) in -stable it is gone from the system even if that bucket > isn't fully used or needed :-( What would you expect to see in the logs on such a scenario? I'm surprised to see nothing. > > Ironically the more memory you put in a system the less you can do with > the system! > > A lot of people are starting to run into this problem since large memory > machines are cheap. Well, I don't think 2gb is large by your standards? > > Doug A. -- -Jim From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 00:23:07 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 DB26B16A4CE for ; Sat, 2 Oct 2004 00:23:06 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5BA1E43D1F for ; Sat, 2 Oct 2004 00:23:06 +0000 (GMT) (envelope-from durham@jcdurham.com) Received: from dhcp13.home.jcdurham.com (dhcp13.home.jcdurham.com [192.168.5.13]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i920N5ZU077610; Fri, 1 Oct 2004 20:23:05 -0400 (EDT) (envelope-from durham@jcdurham.com) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Fri, 1 Oct 2004 20:23:04 -0400 User-Agent: KMail/1.7 References: <200409301003.00492.durham@jcdurham.com> <20041001223802.GA90717@xor.obsecurity.org> In-Reply-To: <20041001223802.GA90717@xor.obsecurity.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410012023.04922.durham@jcdurham.com> cc: Kris Kennaway Subject: Re: Sudden Reboots 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, 02 Oct 2004 00:23:07 -0000 On Friday 01 October 2004 06:38 pm, Kris Kennaway wrote: > On Thu, Sep 30, 2004 at 10:03:00AM -0400, Jim Durham wrote: > > I have had this problem now with at least 3 FreeBSD servers over a period > > of about 2 years. I had put it down to some hardware problem but it seems > > to be too much of a coincidence with 3 different machines doing the same > > thing. > > > > The first time was when I put 4.5-RELEASE on a brand new Dell Poweredge > > 2650. I ran it on the bench for a week or so, then decided all was well > > and put it in the server rack and started doing the company's email > > service on it. After a few weeks, it suddenly would 'reboot' for no > > apparent reason. No log entries, nothing at all except the usual stuff in > > /var/log/messages about '/ was not unmounted correctly', etc. Just like > > you had pulled the power plug. > > > > The 2nd instance was a server that I maintain for an ISP that was a > > mirror image of their primary server, a 'hot spare' so to speak. The > > primary, running the same software was solid, but the backup would reboot > > at about 5:20 every morning with the same syndrome..no log entries of any > > sort and just the usual entries in /var/log messages saying the the / > > partition was not unmounted properly. The odd thing was that it was > > happening at virtually the same time every morning. > > > > I upgraded both systems to the latest -RELEASE and it made no > > difference. Then, they both just *stopped doing it by themselves* with no > > apparent correlation to anything installed software-wise. Neither server > > has had any problem for over a year now. > > > > The 3rd instance is happening now. Another server I maintain for my > > 'night job' is doing the same thing for a customer. It just 'stops' like > > you pulled the power plug. However, this time I thought to check using > > 'last' and found that I had accidentally left an ssh session open and > > that entry said 'crash'. There are no other log entries I can find > > related to the 'reboot'. > > Do you have ddb enabled? If not, the machine may be panicking and > rebooting automatically. No. Not on any of the 3 boxes. Like I said, the problem has gone away and not returned on the Dell and the ISP's box and the loads on those boxes are always increasing and they've been fine for over a year now. It was just when this same thing started with a customer's server box that I started to wonder if it was some very intermittent problem in the kernel. > Actual "spontaneous reboots" are very rare These are very rare.... except they seem to happen about once a day for a while and then stop... very strange.. > and usually caused by hardware problems (e.g. faulty power supply, > overheating CPU, bad RAM). Possible, but if so, the hardware fixed itself on the first two boxes I mentioned. > Enable DDB, and see what happens the next > time it crashes. I'll try that on the one that's doing it now. Any suggestions as to how to log this to get the moset info ? I've not played with ddb, but I'll read the docs and get it going. Thanks much to all who responded! > > Kris -- -Jim From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 00:33: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 9247616A4CE for ; Sat, 2 Oct 2004 00:33:40 +0000 (GMT) Received: from obsecurity.dyndns.org (CPE0050040655c8-CM00111ae02aac.cpe.net.cable.rogers.com [69.194.102.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6170743D58 for ; Sat, 2 Oct 2004 00:33:40 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id B4AF35149E; Fri, 1 Oct 2004 17:34:23 -0700 (PDT) Date: Fri, 1 Oct 2004 17:34:23 -0700 From: Kris Kennaway To: Jim Durham Message-ID: <20041002003423.GA96815@xor.obsecurity.org> References: <200409301003.00492.durham@jcdurham.com> <20041001223802.GA90717@xor.obsecurity.org> <200410012023.04922.durham@jcdurham.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ikeVEW9yuYc//A+q" Content-Disposition: inline In-Reply-To: <200410012023.04922.durham@jcdurham.com> User-Agent: Mutt/1.4.2.1i cc: freebsd-hackers@freebsd.org cc: Kris Kennaway Subject: Re: Sudden Reboots 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, 02 Oct 2004 00:33:40 -0000 --ikeVEW9yuYc//A+q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 01, 2004 at 08:23:04PM -0400, Jim Durham wrote: > > Actual "spontaneous reboots" are very rare=20 >=20 > These are very rare.... except they seem to happen about once a day for a= =20 > while and then stop... very strange.. >=20 > > and usually caused by hardware problems (e.g. faulty power supply, > > overheating CPU, bad RAM).=20 >=20 > Possible, but if so, the hardware fixed itself on the first two boxes I= =20 > mentioned.=20 Consistent with marginal hardware issues (heating, poorly seated PCI cards, fluctuating power supply, ...). > > Enable DDB, and see what happens the next=20 > > time it crashes. >=20 > I'll try that on the one that's doing it now. Any suggestions as to how t= o log=20 > this to get the moset info ? Set up a serial console and use that. It's well-documented in the handbook and developer's handbook. Kris --ikeVEW9yuYc//A+q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXfePWry0BWjoQKURAioXAKD43W9jcI9fu5/i8asmMD/2Rz5V2ACgovYb sYVAjfG5tSvyh22lPTcCtvM= =h4ve -----END PGP SIGNATURE----- --ikeVEW9yuYc//A+q-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 00:37: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 03EAD16A4CE for ; Sat, 2 Oct 2004 00:37:36 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CFB043D41 for ; Sat, 2 Oct 2004 00:37:35 +0000 (GMT) (envelope-from durham@jcdurham.com) Received: from dhcp13.home.jcdurham.com (dhcp13.home.jcdurham.com [192.168.5.13]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i920bZEl078199 for ; Fri, 1 Oct 2004 20:37:35 -0400 (EDT) (envelope-from durham@jcdurham.com) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Fri, 1 Oct 2004 20:37:34 -0400 User-Agent: KMail/1.7 References: <200409301003.00492.durham@jcdurham.com> <20041001223802.GA90717@xor.obsecurity.org> In-Reply-To: <20041001223802.GA90717@xor.obsecurity.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410012037.34769.durham@jcdurham.com> Subject: Re: Sudden Reboots 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, 02 Oct 2004 00:37:36 -0000 On Friday 01 October 2004 06:38 pm, Kris Kennaway wrote: > Do you have ddb enabled? I just recompiled the kernel (4.10 patchlevel 3) and installed it. It's in use right now and I can't reboot it, but it may do so for me! 8- ). If not, I'll do it early tommorow AM. I used options DDB and DDB_UNATTENDED as there is no one at that site who knows anything about *nix servers and I need it to come back up if it panics.. -- -Jim From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 00:40: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 79F7516A4CE for ; Sat, 2 Oct 2004 00:40:57 +0000 (GMT) Received: from obsecurity.dyndns.org (CPE0050040655c8-CM00111ae02aac.cpe.net.cable.rogers.com [69.194.102.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5163E43D2F for ; Sat, 2 Oct 2004 00:40:57 +0000 (GMT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id A415F5149E; Fri, 1 Oct 2004 17:41:40 -0700 (PDT) Date: Fri, 1 Oct 2004 17:41:40 -0700 From: Kris Kennaway To: Jim Durham Message-ID: <20041002004140.GA96922@xor.obsecurity.org> References: <200409301003.00492.durham@jcdurham.com> <20041001223802.GA90717@xor.obsecurity.org> <200410012037.34769.durham@jcdurham.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" Content-Disposition: inline In-Reply-To: <200410012037.34769.durham@jcdurham.com> User-Agent: Mutt/1.4.2.1i cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots 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, 02 Oct 2004 00:40:57 -0000 --lrZ03NoBR/3+SXJZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 01, 2004 at 08:37:34PM -0400, Jim Durham wrote: > On Friday 01 October 2004 06:38 pm, Kris Kennaway wrote: >=20 > > Do you have ddb enabled? =20 >=20 > I just recompiled the kernel (4.10 patchlevel 3) and installed it. It's i= n use=20 > right now and I can't reboot it, but it may do so for me! 8- ). If not,= =20 > I'll do it early tommorow AM. I used options DDB and DDB_UNATTENDED as t= here=20 > is no one at that site who knows anything about *nix servers and I need i= t to=20 > come back up if it panics.. Well, DDB_UNATTENDED cancels out the benefit of being able to investigate the system when it crashes ;-) Set up crashdumps instead, or a serial console. Kris --lrZ03NoBR/3+SXJZ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXflEWry0BWjoQKURAlE7AKCLTRzcwGmgmU/OKLN81hdnc2DIeQCfdoG0 KY14s9yjYrmh6Xd+ZBT5HAY= =LGgO -----END PGP SIGNATURE----- --lrZ03NoBR/3+SXJZ-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 01:56: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 7BAE716A4D0 for ; Sat, 2 Oct 2004 01:56:54 +0000 (GMT) Received: from mail.ambrisko.com (adsl-64-174-51-43.dsl.snfc21.pacbell.net [64.174.51.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43D6D43D48 for ; Sat, 2 Oct 2004 01:56:54 +0000 (GMT) (envelope-from ambrisko@ambrisko.com) Received: from server2.ambrisko.com (HELO www.ambrisko.com) (192.168.1.2) by mail.ambrisko.com with ESMTP; 01 Oct 2004 18:56:53 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by www.ambrisko.com (8.12.9p2/8.12.9) with ESMTP id i921urkT022467; Fri, 1 Oct 2004 18:56:53 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.12.9p2/8.12.9/Submit) id i921ur8k022466; Fri, 1 Oct 2004 18:56:53 -0700 (PDT) (envelope-from ambrisko) From: Doug Ambrisko Message-Id: <200410020156.i921ur8k022466@ambrisko.com> In-Reply-To: <200410012016.51415.durham@jcdurham.com> To: Jim Durham Date: Fri, 1 Oct 2004 18:56:53 -0700 (PDT) X-Mailer: ELM [version 2.4ME+ PL94b (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots 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, 02 Oct 2004 01:56:55 -0000 Jim Durham writes: [ Charset ISO-8859-1 unsupported, converting... ] | On Friday 01 October 2004 12:36 pm, Doug Ambrisko wrote: | > Jim Durham writes: | > | I have had this problem now with at least 3 FreeBSD servers over a period | > | of about 2 years. I had put it down to some hardware problem but it seems | > | to be too much of a coincidence with 3 different machines doing the same | > | thing. | | > How much memory are in these system?. | The Dell is a Dual Xeon 2650 with 2gb or Ram. The ISP's box has only 256 megs | or ram and the business customer's box has 512. That shouldn't be much of an issue then | > If you have 3G or more you end | > up with very little left for the kernel in the 2G space | | Can you elaborate on why this is? I did somewhat here: | > If you only have a few meg. left it doesn't take many processes to | > fork etc. then you machine blows up. The bge driver for example takes | > 4M each for the jumbo packet handling. You can recover some of this | > memory via loader.conf tunables or bump KVA_PAGES in your kernel | > config file. Still once this memory is put into the zone allocator | > (vmstat -z) in -stable it is gone from the system even if that bucket | > isn't fully used or needed :-( Most of these zones scale based on total memory which. | What would you expect to see in the logs on such a scenario? I'm surprised to | see nothing. Unless you have kernel dumps and savecore settup you will miss the panic. When a system panics it can't right our to /var/log/* | > Ironically the more memory you put in a system the less you can do with | > the system! | > | > A lot of people are starting to run into this problem since large memory | > machines are cheap. | | Well, I don't think 2gb is large by your standards? No it isn't. 3-4G machines start to hit this. Also if you bump up things like mbufs and cluster you start to hit this limit. Doug A. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 02:17: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 7238B16A4CE; Sat, 2 Oct 2004 02:17:09 +0000 (GMT) Received: from tinker.exit.com (tinker.exit.com [206.223.0.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32DC743D58; Sat, 2 Oct 2004 02:17:09 +0000 (GMT) (envelope-from frank@exit.com) Received: from realtime.exit.com (realtime [206.223.0.5]) by tinker.exit.com (8.12.11/8.12.9) with ESMTP id i922H8FQ094324; Fri, 1 Oct 2004 19:17:08 -0700 (PDT) (envelope-from frank@exit.com) Received: from realtime.exit.com (localhost [127.0.0.1]) by realtime.exit.com (8.13.1/8.12.9) with ESMTP id i922H8jp006059; Fri, 1 Oct 2004 19:17:08 -0700 (PDT) (envelope-from frank@realtime.exit.com) Received: (from frank@localhost) by realtime.exit.com (8.13.1/8.13.1/Submit) id i922H8Tp006058; Fri, 1 Oct 2004 19:17:08 -0700 (PDT) (envelope-from frank) From: Frank Mayhar Message-Id: <200410020217.i922H8Tp006058@realtime.exit.com> To: freebsd-hackers@freebsd.org Date: Fri, 1 Oct 2004 19:17:08 -0700 (PDT) X-Copyright0: Copyright 2004 Frank Mayhar. All Rights Reserved. X-Copyright1: Permission granted for electronic reproduction as Usenet News or email only. X-Mailer: ELM [version 2.4ME+ PL119 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII cc: freebsd-current@freebsd.org Subject: Amazing. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: frank@exit.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2004 02:17:09 -0000 I just want to drop a line to you folks (and to Bill Paul in particular) to express my appreciation for your work. I received my new laptop today after my old one finally succumbed to a combination of old age and ancient coffee spills. I installed 5.3-BETA6 on it immediately, no trouble, it knew about the Broadcom NIC out of the box and I did a quick check to learn how to set up ndis so I could use the Dell (actually Broadcom) wireless NIC as well. Built ndis, converted the Windows driver, built if_ndis, installed it, loaded it, configured the interface, ran dhclient and I'm using it as I type this. Took maybe an hour, including burning the driver and /usr/src on a DVD to carry into the living room. I was so impressed that I just had to write and say so. Kudos to you guys. You do good work. After having had to deal with the insides of Linux for the last year, it's a pleasure to use a system that is built with such professionalism. Thanks! -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/ From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 02:50:32 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 94C4916A4CE for ; Sat, 2 Oct 2004 02:50:32 +0000 (GMT) Received: from osgood.cc.nd.edu (osgood.cc.nd.edu [129.74.250.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26F2243D39 for ; Sat, 2 Oct 2004 02:50:32 +0000 (GMT) (envelope-from dmschei@attglobal.net) Received: from [10.0.1.2] (scheidt-rout.canopy.nd.edu [129.74.98.169]) (authenticated bits=0)i922oPQG022878 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Fri, 1 Oct 2004 21:50:26 -0500 (EST) In-Reply-To: <200410012023.04922.durham@jcdurham.com> References: <200409301003.00492.durham@jcdurham.com> <20041001223802.GA90717@xor.obsecurity.org> <200410012023.04922.durham@jcdurham.com> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: David Scheidt Date: Fri, 1 Oct 2004 21:50:26 -0500 To: Jim Durham X-Mailer: Apple Mail (2.619) X-ND-MTA-Date: Fri, 01 Oct 2004 21:50:31 -0500 (EST) X-ND-Virus-Scan: engine v4.3.20; dat v4396 cc: freebsd-hackers@freebsd.org cc: Kris Kennaway Subject: Re: Sudden Reboots 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, 02 Oct 2004 02:50:32 -0000 On Oct 1, 2004, at 7:23 PM, Jim Durham wrote: > These are very rare.... except they seem to happen about once a day > for a > while and then stop... very strange.. > >> and usually caused by hardware problems (e.g. faulty power supply, >> overheating CPU, bad RAM). > > Possible, but if so, the hardware fixed itself on the first two boxes I > mentioned. All of this can be bad, or not quite bad -- just not healthy -- hardware. Say a power supply that can't supply reliable +5, when the line voltage drops a tad while all the disks are being hammered. It can be a nightmare to figure out. Setup crash dumps, but also make sure that the UPS the box is attached to isn't having problems. If it's not on conditioned power, fix that. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 03:33: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 C27BE16A4CE for ; Sat, 2 Oct 2004 03:33:31 +0000 (GMT) Received: from cruzio.com (dsl3-63-249-85-132.cruzio.com [63.249.85.132]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6193443D2F for ; Sat, 2 Oct 2004 03:33:31 +0000 (GMT) (envelope-from brucem@mail.cruzio.com) Received: from mail.cruzio.com (localhost [127.0.0.1]) by cruzio.com (8.12.10/8.12.10) with ESMTP id i923YbkD000384; Fri, 1 Oct 2004 20:34:37 -0700 (PDT) (envelope-from brucem@mail.cruzio.com) Received: (from brucem@localhost) by mail.cruzio.com (8.12.10/8.12.10/Submit) id i923YbYB000383; Fri, 1 Oct 2004 20:34:37 -0700 (PDT) (envelope-from brucem) Date: Fri, 1 Oct 2004 20:34:37 -0700 (PDT) From: "Bruce R. Montague" Message-Id: <200410020334.i923YbYB000383@mail.cruzio.com> To: freebsd-hackers@freebsd.org cc: durham@jcdurham.com Subject: Re: Sudden Reboots 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, 02 Oct 2004 03:33:32 -0000 Hi, re: > The odd thing was that it was happening at virtualy > the same time every morning.... > [...] > Then, they both just *stopped doing it by themselves* with no apparent > correlation to anything installed software-wise. Neither server has had any > problem for over a year now. * What was the external power situation, grounding, static situation, or other "noise"? Was the UPS or power-conditioning OK? Any large radars nearby? :) Radars have actually been known to matter. I once knew a system that died like this and it turned out to be because it was mounted three floors above a loading dock... a ROM pin or somesuch was doing a great job as a vibration detector, whenever trucks backed into the dock hard. Which brings up the question, what's the cheapest/best way these days to atually monitor high-res sags/spikes/sags on the line into a box? Decades ago it was a Drantez meter; I see they're still around: www.dranetz-bmi.com Does anyone have any such "line-monitor" unit that they particularly recommend as a good low-end buy? * Handwaving general remark about VM space overhead... Early virtual memory systems rapidly ran into the problem that all of physical memory became consummed by page tables. The solution was to page the page tables (which is why modern architectures support hierarchies of page tables). As systems become larger this solution typically becomes less-and-less effective, because each page in every _virtual_ address space requires a page table entry. If you have many large addresses spaces, this requires many page table entries total (this acts as pressure to make pages larger). The page tables become large data structures; managing them (keeping parts in memory when needed) can become a bottleneck. If you have other restrictions (the page tables have to fit in an address space segment, say, a kernel data segment), the virtual space allocated for this data structure can become exhausted. A kernel usually needs to have page tables that can map every page of physical memory, so for this page table, the more physical memory present, the larger the table. Page tables are used because they allow a page table entry to be accessed via a simple addition based on most of the virtual address. This is fast. As address spaces grow above 32-bits, the potential size of the page tables becomes more important. For very large address spaces some form of "single-level store" or "inverted page table" scheme is often proposed. Instead of having a page table entry for each page of virtual address space, these systems have the equivalent of a page table entry for each page of _physical_ memory. All addresses are effectively disk-block+offset addresses; the virtual memory hardware does an associative search to locate the physical block in memory that corresponds to the disk-block. This requires more expensive hardware then a simple addition, but such systems only require a page table entry for every page of physical memory. These systems have been built from early days, but are typically not competitive with VM systems that require simple addition. (I think the IBM AS/400 is the only widely-used commercial hardware using this approach) At some point address space growth, cheap associative lookup memories, and required page table size may make this approach competitive. - bruce From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 05:44:20 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 CDAF016A4CE for ; Sat, 2 Oct 2004 05:44:20 +0000 (GMT) Received: from w2xo.jcdurham.com (18.gibs5.xdsl.nauticom.net [209.195.184.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5417843D54 for ; Sat, 2 Oct 2004 05:44:20 +0000 (GMT) (envelope-from durham@jcdurham.com) Received: from dhcp13.home.jcdurham.com (dhcp13.home.jcdurham.com [192.168.5.13]) by w2xo.jcdurham.com (8.12.11/8.11.6) with ESMTP id i925iJL4086308; Sat, 2 Oct 2004 01:44:19 -0400 (EDT) (envelope-from durham@jcdurham.com) From: Jim Durham To: freebsd-hackers@freebsd.org Date: Sat, 2 Oct 2004 01:44:17 -0400 User-Agent: KMail/1.7 References: <200410020334.i923YbYB000383@mail.cruzio.com> In-Reply-To: <200410020334.i923YbYB000383@mail.cruzio.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410020144.17936.durham@jcdurham.com> Subject: Re: Sudden Reboots 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, 02 Oct 2004 05:44:20 -0000 On Friday 01 October 2004 11:34 pm, Bruce R. Montague wrote: > Hi, re: > > The odd thing was that it was happening at virtualy > > the same time every morning.... > > [...] > > Then, they both just *stopped doing it by themselves* with no apparent > > correlation to anything installed software-wise. Neither server has had > > any problem for over a year now. > > * What was the external power situation, grounding, > static situation, or other "noise"? Was the UPS or > power-conditioning OK? Same rack, same UPS as all the other Dell 2650 servers. Same ethernet switches, etc. Same UPS. > Any large radars nearby? :) Nope.. > Radars have actually been known to matter. I once > knew a system that died like this and it turned out > to be because it was mounted three floors above a > loading dock... a ROM pin or somesuch was doing a > great job as a vibration detector, whenever trucks > backed into the dock hard. > > Which brings up the question, what's the cheapest/best > way these days to atually monitor high-res > sags/spikes/sags on the line into a box? Decades ago > it was a Drantez meter; I see they're still around: > www.dranetz-bmi.com You used to be able to get the power company to come out and put recording voltmeters on the line if you complained loudly enough.. > > Does anyone have any such "line-monitor" unit that > they particularly recommend as a good low-end buy? > > > * Handwaving general remark about VM space overhead... > Early virtual memory systems rapidly ran into the > problem that all of physical memory became consummed > by page tables. The solution was to page the page > tables (which is why modern architectures support > hierarchies of page tables). As systems become larger > this solution typically becomes less-and-less > effective, because each page in every _virtual_ > address space requires a page table entry. If you > have many large addresses spaces, this requires many > page table entries total (this acts as pressure to > make pages larger). The page tables become large > data structures; managing them (keeping parts in > memory when needed) can become a bottleneck. If you > have other restrictions (the page tables have to fit > in an address space segment, say, a kernel data > segment), the virtual space allocated for this data > structure can become exhausted. A kernel usually > needs to have page tables that can map every page > of physical memory, so for this page table, the more > physical memory present, the larger the table. > > Page tables are used because they allow a page table > entry to be accessed via a simple addition based > on most of the virtual address. This is fast. > > As address spaces grow above 32-bits, the potential > size of the page tables becomes more important. For > very large address spaces some form of "single-level > store" or "inverted page table" scheme is often > proposed. Instead of having a page table entry for > each page of virtual address space, these systems > have the equivalent of a page table entry for each > page of _physical_ memory. All addresses are effectively > disk-block+offset addresses; the virtual memory > hardware does an associative search to locate the > physical block in memory that corresponds to the > disk-block. This requires more expensive hardware > then a simple addition, but such systems only require > a page table entry for every page of physical memory. > These systems have been built from early days, but > are typically not competitive with VM systems that > require simple addition. (I think the IBM AS/400 is > the only widely-used commercial hardware using this > approach) At some point address space growth, cheap > associative lookup memories, and required page table > size may make this approach competitive. Yes, wow...you're dragging me back to CS-401 or whatever. We had a page fault indicating meter that you played around with different algorithms on and tried to get it to read lower. I think it was on a PDP-40. (Wow..am I old). > Thanks to all for the suggestions. I'm still not totally convinced it's hardware. Try googling for "FreeBSD Sudden Reboot" and you'll see a lot of the same syndrome. BTW, healthd is running on that box and show this: Temp.= 49.0, 41.5, 0.0; Rot.= 5113, 0, 0 Vcore = 1.71, 0.00; Volt. = 3.34, 4.89, 12.04, -1.78, -0.91 that's all well within limits. The two temps are proc and chip set. The rest is pretty self-explanatory. Once again...much appreciated all who commented. -- -Jim From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 07:55:56 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 7C90616A4CE for ; Sat, 2 Oct 2004 07:55:56 +0000 (GMT) Received: from web53209.mail.yahoo.com (web53209.mail.yahoo.com [206.190.39.225]) by mx1.FreeBSD.org (Postfix) with SMTP id 1A11343D1F for ; Sat, 2 Oct 2004 07:55:56 +0000 (GMT) (envelope-from jasonosgerby@yahoo.com) Message-ID: <20041002075555.2466.qmail@web53209.mail.yahoo.com> Received: from [69.29.71.93] by web53209.mail.yahoo.com via HTTP; Sat, 02 Oct 2004 00:55:55 PDT Date: Sat, 2 Oct 2004 00:55:55 -0700 (PDT) From: Jason Osgerby To: freebsd-hackers@freebsd.org In-Reply-To: <200410020217.i922H8Tp006058@realtime.exit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Re: Amazing. 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, 02 Oct 2004 07:55:56 -0000 Did you have any trouble setting up Xorg on it? I recently attempted to upgrade this machine, an old Pentium 2 box, from 4.10 to 5.3 Beta 6 just to take a look at the new features, but whenever I tried to run startx after Xorg -configure had finished running, the screen would flash then simply go back out to the console with the message "waiting for the X server to shut down." I tried all kinds of things to make it work, but no go. Any ideas what I could be missing, anyone? Frank Mayhar wrote: I just want to drop a line to you folks (and to Bill Paul in particular) to express my appreciation for your work. I received my new laptop today after my old one finally succumbed to a combination of old age and ancient coffee spills. I installed 5.3-BETA6 on it immediately, no trouble, it knew about the Broadcom NIC out of the box and I did a quick check to learn how to set up ndis so I could use the Dell (actually Broadcom) wireless NIC as well. Built ndis, converted the Windows driver, built if_ndis, installed it, loaded it, configured the interface, ran dhclient and I'm using it as I type this. Took maybe an hour, including burning the driver and /usr/src on a DVD to carry into the living room. I was so impressed that I just had to write and say so. Kudos to you guys. You do good work. After having had to deal with the insides of Linux for the last year, it's a pleasure to use a system that is built with such professionalism. Thanks! -- Frank Mayhar frank@exit.com http://www.exit.com/ Exit Consulting http://www.gpsclock.com/ http://www.exit.com/blog/frank/ _______________________________________________ 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" --------------------------------- Do you Yahoo!? vote.yahoo.com - Register online to vote today! From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:19: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 4151016A4CE for ; Sat, 2 Oct 2004 08:19:37 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D61B43D3F for ; Sat, 2 Oct 2004 08:19:36 +0000 (GMT) (envelope-from keramida@FreeBSD.org) Received: from gothmog.gr (patr530-a020.otenet.gr [212.205.215.20]) i928JWsS012207 for ; Sat, 2 Oct 2004 11:19:33 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i928JTbK031590 for ; Sat, 2 Oct 2004 11:19:29 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i928JSHu031585 for freebsd-hackers@freebsd.org; Sat, 2 Oct 2004 11:19:28 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Date: Sat, 2 Oct 2004 11:19:28 +0300 From: Giorgos Keramidas To: freebsd-hackers@FreeBSD.org Message-ID: <20041002081928.GA21439@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 08:19:37 -0000 John Beck, who works for Sun, has posted an entry in his blog yesterday about "rm -fr /" protection, which I liked a lot: http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection His idea was remarkably simple, so I went ahead and wrote this patch for rm(1) of FreeBSD: %%% Index: rm.c =================================================================== RCS file: /home/ncvs/src/bin/rm/rm.c,v retrieving revision 1.47 diff -u -r1.47 rm.c --- rm.c 6 Apr 2004 20:06:50 -0000 1.47 +++ rm.c 2 Oct 2004 08:06:21 -0000 @@ -157,6 +157,7 @@ void rm_tree(char **argv) { + char **argv_tmp; FTS *fts; FTSENT *p; int needstat; @@ -164,6 +165,17 @@ int rval; /* + * If one of the members of argv[] is the root directory abort the + * entire operation. + */ + argv_tmp = argv; + while (*argv_tmp != NULL) { + if (strcmp(*argv_tmp, "/") == 0) + errx(1, "rm of / is not allowed"); + argv_tmp++; + } + + /* * Remove a file hierarchy. If forcing removal (-f), or interactive * (-i) or can't ask anyway (stdin_ok), don't stat the file. */ %%% To test it, I used a minimal chroot with /bin, /lib and /libexec copied over from my real / partition: # mkdir -p /tmp/chroot/bin ; cp -Rp /lib /libexec /tmp/chroot # cp /bin/sh /bin/ls /tmp/chroot/bin # cp /a/freebsd/src/bin/rm/rm /tmp/chroot/bin # env PS1='chroot# ' chroot /tmp/chroot /bin/sh chroot# rm -fr / rm: recursive rm of / is not allowed chroot# exit # It seems to work nicely here. I'm not sure if the overhead of traversing argv[] twice is a bug price to pay for the protection this adds, but if a lot of people like it I'll commit it when I get the approval of src-committers :-) - Giorgos From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:33: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 80DFB16A4CE; Sat, 2 Oct 2004 08:33:40 +0000 (GMT) Received: from mailout2.barnet.com.au (mailout2.barnet.com.au [218.185.88.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAF7743D1F; Sat, 2 Oct 2004 08:33:39 +0000 (GMT) (envelope-from edwin@mavetju.org) Received: by mailout2.barnet.com.au (Postfix, from userid 27) id 39B0D70744D; Sat, 2 Oct 2004 18:33:38 +1000 (EST) X-Viruscan-Id: <415E67E2000112B89F9A8C@BarNet> Received: from mail2-auth.barnet.com.au (mailout2.barnet.com.au [218.185.88.16]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Authority" (verified OK)) by mail2.barnet.com.au (Postfix) with ESMTP id EA82070744C; Sat, 2 Oct 2004 18:33:37 +1000 (EST) Received: from k7.mavetju (edwin-3.int.barnet.com.au [10.10.12.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) Certificate Authority" (verified OK)) by mail2-auth.barnet.com.au (Postfix) with ESMTP id 64779707448; Sat, 2 Oct 2004 18:33:37 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 2A6366225; Sat, 2 Oct 2004 18:33:36 +1000 (EST) Date: Sat, 2 Oct 2004 18:33:36 +1000 From: Edwin Groothuis To: Giorgos Keramidas Message-ID: <20041002083336.GA10355@k7.mavetju> Mail-Followup-To: Edwin Groothuis , Giorgos Keramidas , freebsd-hackers@FreeBSD.org References: <20041002081928.GA21439@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002081928.GA21439@gothmog.gr> User-Agent: Mutt/1.5.6i cc: freebsd-hackers@FreeBSD.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 08:33:40 -0000 On Sat, Oct 02, 2004 at 11:19:28AM +0300, Giorgos Keramidas wrote: > John Beck, who works for Sun, has posted an entry in his blog yesterday > about "rm -fr /" protection, which I liked a lot: > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > His idea was remarkably simple, so I went ahead and wrote this patch for > rm(1) of FreeBSD: I'm not so much worried about 'rm -rf /', but I'm more worried about "rm -rf *" in my home directory. It happened once because I was too happy switching directories before realising what I was doing in the wrong directory. Also, refusing to do it is not the ideal way to go, I think that if you have two -f's specified it would do it anyway. Just my two cents of course. Edwin -- Edwin Groothuis | Personal website: http://www.mavetju.org edwin@mavetju.org | Weblog: http://weblog.barnet.com.au/edwin/ From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:34: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 57DBE16A4CE; Sat, 2 Oct 2004 08:34:27 +0000 (GMT) Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id E1E5443D41; Sat, 2 Oct 2004 08:34:26 +0000 (GMT) (envelope-from mike@reifenberger.com) Received: from fwd05.aul.t-online.de by mailout07.sul.t-online.com with smtp id 1CDfLV-0004O2-00; Sat, 02 Oct 2004 10:34:25 +0200 Received: from fw.reifenberger.com (EXLaKYZ6ge8myb9JWIZeRPp4VdcfMap9euiL54NeUE3Xa506L9JRwn@[217.232.221.224]) by fmrl05.sul.t-online.com with esmtp id 1CDfLG-1pdK3U0; Sat, 2 Oct 2004 10:34:10 +0200 Received: from localhost (mike@localhost)i928YAo8022230; Sat, 2 Oct 2004 10:34:10 +0200 (CEST) (envelope-from mike@reifenberger.com) X-Authentication-Warning: fw.reifenberger.com: mike owned process doing -bs Date: Sat, 2 Oct 2004 10:34:09 +0200 (CEST) From: Michael Reifenberger To: Giorgos Keramidas In-Reply-To: <20041002081928.GA21439@gothmog.gr> Message-ID: <20041002102918.W22102@fw.reifenberger.com> References: <20041002081928.GA21439@gothmog.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ID: EXLaKYZ6ge8myb9JWIZeRPp4VdcfMap9euiL54NeUE3Xa506L9JRwn@t-dialin.net X-TOI-MSGID: 9c312ecb-041e-4d27-9be5-0c221ad7e32f cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 08:34:27 -0000 On Sat, 2 Oct 2004, Giorgos Keramidas wrote: > Date: Sat, 2 Oct 2004 11:19:28 +0300 > From: Giorgos Keramidas > To: freebsd-hackers@freebsd.org > Subject: Protection from the dreaded "rm -fr /" > > John Beck, who works for Sun, has posted an entry in his blog yesterday > about "rm -fr /" protection, which I liked a lot: > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > His idea was remarkably simple, so I went ahead and wrote this patch for > rm(1) of FreeBSD: > This does only help for the obvious case of '/' but not for the './' and '../' or '../../' ... accidents. Furthermore does it prevent root from doing `rm -rf /` which is a pretty legal operation for root since he knows what he is doing. This is UNIX, not Windows. Bye/2 --- Michael Reifenberger, Business Development Manager SAP-Basis, Plaut Consulting Comp: Michael.Reifenberger@plaut.de | Priv: Michael@Reifenberger.com http://www.plaut.de | http://www.Reifenberger.com From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:40: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 CD15F16A4D0 for ; Sat, 2 Oct 2004 08:40:02 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 05CAF43D58 for ; Sat, 2 Oct 2004 08:40:02 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a232.otenet.gr [212.205.215.232]) i928dv4A024997 for ; Sat, 2 Oct 2004 11:39:57 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i928Xfts044355 for ; Sat, 2 Oct 2004 11:33:41 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i928XfDh044354 for freebsd-hackers@freebsd.org; Sat, 2 Oct 2004 11:33:41 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 11:33:41 +0300 From: Giorgos Keramidas To: freebsd-hackers@freebsd.org Message-ID: <20041002083341.GB21439@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002081928.GA21439@gothmog.gr> Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 08:40:02 -0000 On 2004-10-02 11:19, Giorgos Keramidas wrote: > John Beck, who works for Sun, has posted an entry in his blog yesterday > about "rm -fr /" protection, which I liked a lot: > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection Here's a simpler diff, which I wrote after I looked a bit in the while-loop I had and realized it was really an obfuscated for-loop: %%% Index: rm.c =================================================================== RCS file: /home/ncvs/src/bin/rm/rm.c,v retrieving revision 1.47 diff -u -r1.47 rm.c --- rm.c 6 Apr 2004 20:06:50 -0000 1.47 +++ rm.c 2 Oct 2004 08:28:36 -0000 @@ -157,6 +157,7 @@ void rm_tree(char **argv) { + char **argv_tmp; FTS *fts; FTSENT *p; int needstat; @@ -164,6 +165,14 @@ int rval; /* + * If one of the members of argv[] is the root directory abort the + * entire operation. + */ + for (argv_tmp = argv; *argv_tmp != NULL; argv_tmp++) + if (strcmp(*argv_tmp, "/") == 0) + errx(1, "recursive rm of / is not allowed"); + + /* * Remove a file hierarchy. If forcing removal (-f), or interactive * (-i) or can't ask anyway (stdin_ok), don't stat the file. */ %%% From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:51: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 0411716A4CE for ; Sat, 2 Oct 2004 08:51:48 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 537C543D31 for ; Sat, 2 Oct 2004 08:51:47 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a232.otenet.gr [212.205.215.232]) i928piOn015016; Sat, 2 Oct 2004 11:51:45 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i928phm3063391; Sat, 2 Oct 2004 11:51:43 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i928ph58063389; Sat, 2 Oct 2004 11:51:43 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 11:51:43 +0300 From: Giorgos Keramidas To: Michael Reifenberger Message-ID: <20041002085143.GA52519@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002102918.W22102@fw.reifenberger.com> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 08:51:48 -0000 On 2004-10-02 10:34, Michael Reifenberger wrote: > On Sat, 2 Oct 2004, Giorgos Keramidas wrote: > >Date: Sat, 2 Oct 2004 11:19:28 +0300 > >From: Giorgos Keramidas > >To: freebsd-hackers@freebsd.org > >Subject: Protection from the dreaded "rm -fr /" > > > >John Beck, who works for Sun, has posted an entry in his blog yesterday > >about "rm -fr /" protection, which I liked a lot: > >http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > > >His idea was remarkably simple, so I went ahead and wrote this patch for > >rm(1) of FreeBSD: > > This does only help for the obvious case of '/' but not for the > './' and '../' or '../../' ... accidents. Hmm, indeed. This can be fixed, but it might take a little thinking over about ways to implement it without adding too much overhead to the way rm(1) works now. > Furthermore does it prevent root from doing `rm -rf /` which is a pretty > legal operation for root since he knows what he is doing. > > This is UNIX, not Windows. Yes, so? Does it mean we should always point guns at our feet and hope that we don't accidentally pull the trigger because some unlucky event made us jump a bit up? The reason I liked this idea is that root has zillions of other ways to destroy an entire system, but not many of them are likely to be the result of mistyping a single character as shown below: # rm -fr / home/someuser/* A single extra space can really wreak havoc in this case. If the real intention of the superuser is to delete everything, he can repartition his disk, he can dd if=/dev/zero of=/dev/ad0, he can do many things. Adding protection that prevents foot-shooting is not something without precedent to FreeBSD either: http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/boot0cfg/boot0cfg.c.diff?r1=1.13&r2=1.14 Having said that, if most people do like the change but there are others who don't, I can always make it work as before with a double -f option. - Giorgos From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:52: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 D346016A4CE for ; Sat, 2 Oct 2004 08:52:25 +0000 (GMT) Received: from node15.coopprint.com (node15.cooperativeprinting.com [208.4.77.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 5352143D53 for ; Sat, 2 Oct 2004 08:52:25 +0000 (GMT) (envelope-from ryans@gamersimpact.com) Received: (qmail 47456 invoked by uid 0); 2 Oct 2004 08:51:54 -0000 Received: from unknown (HELO ?192.168.0.5?) (63.231.165.205) by node15.coopprint.com with SMTP; 2 Oct 2004 08:51:54 -0000 Message-ID: <415E6C4A.1010804@gamersimpact.com> Date: Sat, 02 Oct 2004 03:52:26 -0500 From: Ryan Sommers User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Edwin Groothuis References: <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> In-Reply-To: <20041002083336.GA10355@k7.mavetju> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-hackers@FreeBSD.org cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 08:52:26 -0000 Edwin Groothuis wrote: >On Sat, Oct 02, 2004 at 11:19:28AM +0300, Giorgos Keramidas wrote: > > >>John Beck, who works for Sun, has posted an entry in his blog yesterday >>about "rm -fr /" protection, which I liked a lot: >>http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection >> >>His idea was remarkably simple, so I went ahead and wrote this patch for >>rm(1) of FreeBSD: >> >> > >I'm not so much worried about 'rm -rf /', but I'm more worried about >"rm -rf *" in my home directory. It happened once because I was too >happy switching directories before realising what I was doing in >the wrong directory. > >Also, refusing to do it is not the ideal way to go, I think that >if you have two -f's specified it would do it anyway. Just my two >cents of course. > >Edwin > > If you use tcsh for your shell add: set rmstar to your .cshrc file. Then anytime you use '*' as an argument to rm it will ask you if you are sure you want to do that. As for adding this kind of oops-proofing. I'm not sure I like the idea of completely removing the ability to use / as an argument. How about prompting and needing 'yes' as input? -- Ryan Sommers ryans@gamersimpact.com From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 08:54: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 20D5316A4CE for ; Sat, 2 Oct 2004 08:54:06 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B16843D2F for ; Sat, 2 Oct 2004 08:54:05 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a232.otenet.gr [212.205.215.232]) i928s1Rh030764; Sat, 2 Oct 2004 11:54:03 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i928s181067268; Sat, 2 Oct 2004 11:54:01 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i928s1sN067264; Sat, 2 Oct 2004 11:54:01 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 11:54:01 +0300 From: Giorgos Keramidas To: Edwin Groothuis , freebsd-hackers@freebsd.org Message-ID: <20041002085400.GB52519@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002083336.GA10355@k7.mavetju> Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 08:54:06 -0000 On 2004-10-02 18:33, Edwin Groothuis wrote: > On Sat, Oct 02, 2004 at 11:19:28AM +0300, Giorgos Keramidas wrote: > > John Beck, who works for Sun, has posted an entry in his blog yesterday > > about "rm -fr /" protection, which I liked a lot: > > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > > > His idea was remarkably simple, so I went ahead and wrote this patch for > > rm(1) of FreeBSD: > > I'm not so much worried about 'rm -rf /', but I'm more worried about > "rm -rf *" in my home directory. It happened once because I was too > happy switching directories before realising what I was doing in > the wrong directory. I can't do anything about that, I'm afraid. > Also, refusing to do it is not the ideal way to go, I think that > if you have two -f's specified it would do it anyway. Just my two > cents of course. My intuition tells me that there is practically no case where root would really like to rm -fr the root partition. There are other ways to clean up a disk that are much faster and less prone to accidents. But I can make it behave as it does now with a double -f option. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 09:06: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 E9C9A16A4CE for ; Sat, 2 Oct 2004 09:06:39 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4543143D3F for ; Sat, 2 Oct 2004 09:06:39 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-a232.otenet.gr [212.205.215.232]) i9296ajI027306; Sat, 2 Oct 2004 12:06:37 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i9296a5f072629; Sat, 2 Oct 2004 12:06:36 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i9296aVj072625; Sat, 2 Oct 2004 12:06:36 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 12:06:35 +0300 From: Giorgos Keramidas To: Michael Reifenberger Message-ID: <20041002090635.GA71050@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002085143.GA52519@gothmog.gr> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 09:06:40 -0000 On 2004-10-02 11:51, Giorgos Keramidas wrote: > On 2004-10-02 10:34, Michael Reifenberger wrote: > > > > This does only help for the obvious case of '/' but not for the > > './' and '../' or '../../' ... accidents. > > Hmm, indeed. This can be fixed, but it might take a little thinking > over about ways to implement it without adding too much overhead to the > way rm(1) works now. One way to do that is to use realpath(3), but I have to ask more knowledgeable people about the comment immediately below my change: %%% Index: rm.c =================================================================== RCS file: /home/ncvs/src/bin/rm/rm.c,v retrieving revision 1.47 diff -u -r1.47 rm.c --- rm.c 6 Apr 2004 20:06:50 -0000 1.47 +++ rm.c 2 Oct 2004 09:00:41 -0000 @@ -157,6 +157,8 @@ void rm_tree(char **argv) { + char *rpath; + char **argv_tmp; FTS *fts; FTSENT *p; int needstat; @@ -164,6 +166,20 @@ int rval; /* + * If one of the members of argv[] is the root directory abort the + * entire operation. + */ + rpath = malloc(PATH_MAX * sizeof(char)); + if (rpath == NULL) + err(1, "malloc"); + for (argv_tmp = argv; *argv_tmp != NULL; argv_tmp++) { + if (realpath(*argv_tmp, rpath) == NULL) + err(1, "%s", *argv_tmp); + if (strcmp(rpath, "/") == 0) + errx(1, "recursive rm of / is not allowed"); + } + + /* * Remove a file hierarchy. If forcing removal (-f), or interactive * (-i) or can't ask anyway (stdin_ok), don't stat the file. */ %%% I'm a bit worried about the "don't stat the file" comment below. The realpath(3) library function *does* stat the file when trying to find its real pathname ;-/ From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 09:24: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 D980516A4CE; Sat, 2 Oct 2004 09:24:43 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id EBE2843D1D; Sat, 2 Oct 2004 09:24:42 +0000 (GMT) (envelope-from max@love2party.net) Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CDg8A-00089h-00; Sat, 02 Oct 2004 11:24:42 +0200 Received: from [217.227.153.30] (helo=donor.laier.local) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1CDg89-0006cy-00; Sat, 02 Oct 2004 11:24:42 +0200 From: Max Laier To: freebsd-hackers@freebsd.org Date: Sat, 2 Oct 2004 11:23:52 +0200 User-Agent: KMail/1.7 References: <20041002081928.GA21439@gothmog.gr> In-Reply-To: <20041002081928.GA21439@gothmog.gr> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5081245.8tqfDCvvXC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200410021123.59811.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:61c499deaeeba3ba5be80f48ecc83056 cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 09:24:44 -0000 --nextPart5081245.8tqfDCvvXC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline [ Sorry to be so negative ... ] At very least you should consider to error out silently as POSIX requires "= =2Df"=20 to be silent. Other than that you should really look into the standards and= =20 what they way about rm and friends. I am not a fan of providing seat belts like this. People concerned about th= is,=20 can "alias rm 'rm -i'" etc. etc. Others have commented like this ... If you still have to make this change, make it tuneable with a environment= =20 variable (and make it default to off). On Saturday 02 October 2004 10:19, Giorgos Keramidas wrote: > John Beck, who works for Sun, has posted an entry in his blog yesterday > about "rm -fr /" protection, which I liked a lot: > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > His idea was remarkably simple, so I went ahead and wrote this patch for > rm(1) of FreeBSD: > > %%% > Index: rm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /home/ncvs/src/bin/rm/rm.c,v > retrieving revision 1.47 > diff -u -r1.47 rm.c > --- rm.c 6 Apr 2004 20:06:50 -0000 1.47 > +++ rm.c 2 Oct 2004 08:06:21 -0000 > @@ -157,6 +157,7 @@ > void > rm_tree(char **argv) > { > + char **argv_tmp; > FTS *fts; > FTSENT *p; > int needstat; > @@ -164,6 +165,17 @@ > int rval; > > /* > + * If one of the members of argv[] is the root directory abort the > + * entire operation. > + */ > + argv_tmp =3D argv; > + while (*argv_tmp !=3D NULL) { > + if (strcmp(*argv_tmp, "/") =3D=3D 0) > + errx(1, "rm of / is not allowed"); > + argv_tmp++; > + } > + > + /* > * Remove a file hierarchy. If forcing removal (-f), or interactive > * (-i) or can't ask anyway (stdin_ok), don't stat the file. > */ > %%% > > To test it, I used a minimal chroot with /bin, /lib and /libexec copied > over from my real / partition: > > # mkdir -p /tmp/chroot/bin ; cp -Rp /lib /libexec /tmp/chroot > # cp /bin/sh /bin/ls /tmp/chroot/bin > # cp /a/freebsd/src/bin/rm/rm /tmp/chroot/bin > # env PS1=3D'chroot# ' chroot /tmp/chroot /bin/sh > chroot# rm -fr / > rm: recursive rm of / is not allowed > chroot# exit > # > > It seems to work nicely here. I'm not sure if the overhead of > traversing argv[] twice is a bug price to pay for the protection this > adds, but if a lot of people like it I'll commit it when I get the > approval of src-committers :-) > > - Giorgos > > _______________________________________________ > 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" =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart5081245.8tqfDCvvXC Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBXnOvXyyEoT62BG0RApFGAJ9x6j4OMD1mfia7ZctNC+fjVbb5MACdFTN/ 4kLfpbIeF8/6Y5PmMT24RG4= =J9qe -----END PGP SIGNATURE----- --nextPart5081245.8tqfDCvvXC-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 10:19: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 5D75516A4CE for ; Sat, 2 Oct 2004 10:19:46 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id A481D43D2D for ; Sat, 2 Oct 2004 10:19:45 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b179.otenet.gr [212.205.244.187]) i92AJfJD023758; Sat, 2 Oct 2004 13:19:42 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i92AJdoI023361; Sat, 2 Oct 2004 13:19:39 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i92AIgwD023338; Sat, 2 Oct 2004 13:18:42 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 13:18:42 +0300 From: Giorgos Keramidas To: Ryan Sommers , Max Laier Message-ID: <20041002101842.GA23272@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> <415E6C4A.1010804@gamersimpact.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410021123.59811.max@love2party.net> <415E6C4A.1010804@gamersimpact.com> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 10:19:46 -0000 On 2004-10-02 03:52, Ryan Sommers wrote: > On Sat, Oct 02, 2004 at 11:19:28AM +0300, Giorgos Keramidas wrote: > >about "rm -fr /" protection, which I liked a lot: > >http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > > >His idea was remarkably simple, so I went ahead and wrote this patch > >for > >rm(1) of FreeBSD: > > As for adding this kind of oops-proofing. I'm not sure I like the idea > of completely removing the ability to use / as an argument. How about > prompting and needing 'yes' as input? This might break things because the user hasn't specified -i and will suddenly get a prompt. Unexpected prompts might never get an answer. I liked what Max Laier proposed though, about making this tunable and defaulting to off. See below for the behavior of what I've come up with: On 2004-10-02 11:23, Max Laier wrote: > [ Sorry to be so negative ... ] > > At very least you should consider to error out silently as POSIX > requires "-f" to be silent. Other than that you should really look > into the standards and what they way about rm and friends. Agreed. Thanks for the feedback. Positive replies are not the only sort that are worth a lot :-) How does the following look instead of forcing stuff to the user? 1. Silently erroring out: chroot# export RM_PROTECT_ROOT=1 chroot# /bin/rm -fr / chroot# echo $? 1 chroot# /bin/rm -fr .././ chroot# echo $? 1 2. Warning with an error message because RM_PROTECT_ROOT is set: chroot# export RM_PROTECT_ROOT=1 chroot# /bin/rm -r / rm: recursive rm of / not allowed chroot# /bin/rm -r .././ rm: recursive rm of / not allowed 3. The current behavior as a default when RM_PROTECT_ROOT is unset: chroot# unset RM_PROTECT_ROOT chroot# /bin/rm -r / override rwxr-xr-x 0/0 for /bin/rm? ^Cchroot# chroot# chroot# chroot# /bin/rm -fr / rm: /libexec/ld-elf.so.1: Operation not permitted rm: /libexec: Directory not empty rm: /lib/libc.so.5: Operation not permitted rm: /lib/libcrypt.so.2: Operation not permitted rm: /lib: Directory not empty rm: /: Is a directory chroot# ls -l ls: not found chroot# echo * lib libexec chroot# cd lib chroot# echo * libc.so.5 libcrypt.so.2 chroot# exit Here's the updated diff: %%% Index: rm.c =================================================================== RCS file: /home/ncvs/src/bin/rm/rm.c,v retrieving revision 1.47 diff -u -r1.47 rm.c --- rm.c 6 Apr 2004 20:06:50 -0000 1.47 +++ rm.c 2 Oct 2004 10:06:59 -0000 @@ -57,7 +57,7 @@ #include #include -int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok; +int dflag, eval, fflag, iflag, Pflag, vflag, Wflag, stdin_ok, protect_root; uid_t uid; int check(char *, char *, struct stat *); @@ -100,6 +100,10 @@ exit(eval); } + protect_root = 0; + if (getenv("RM_PROTECT_ROOT") != NULL) + protect_root = 1; + Pflag = rflag = 0; while ((ch = getopt(argc, argv, "dfiPRrvW")) != -1) switch(ch) { @@ -157,6 +161,8 @@ void rm_tree(char **argv) { + static char *rpath = NULL; + char **argv_tmp; FTS *fts; FTSENT *p; int needstat; @@ -164,6 +170,25 @@ int rval; /* + * If enabled in the environment with RM_PROTECT_ROOT disable the + * ability to recursively remove the root directory. + */ + if (protect_root) { + if (rpath == NULL && + (rpath = malloc(PATH_MAX * sizeof(char))) == NULL) + err(1, "malloc"); + for (argv_tmp = argv; *argv_tmp != NULL; argv_tmp++) { + if (realpath(*argv_tmp, rpath) == NULL && + strcmp(rpath, "/") != 0) + continue; + if (fflag != 0) + exit (1); + else + errx(1, "recursive rm of / not allowed"); + } + } + + /* * Remove a file hierarchy. If forcing removal (-f), or interactive * (-i) or can't ask anyway (stdin_ok), don't stat the file. */ %%% From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 10:57:20 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 9DE3F16A4CE for ; Sat, 2 Oct 2004 10:57:20 +0000 (GMT) Received: from gw.gbch.net (gw.gbch.net [203.143.238.93]) by mx1.FreeBSD.org (Postfix) with SMTP id 8EA5743D46 for ; Sat, 2 Oct 2004 10:57:18 +0000 (GMT) (envelope-from gjb@gbch.net) Received: (qmail 78380 invoked from network); 2 Oct 2004 20:57:16 +1000 Received: from felix.gbch.net (mpnc4gm2dctux7kz@172.16.1.6) by bambi.gbch.net with SMTP; 2 Oct 2004 20:57:16 +1000 Received: (qmail 84107 invoked by uid 1001); 2 Oct 2004 20:57:15 +1000 Message-ID: Date: Sat, 2 Oct 2004 20:57:15 +1000 From: Greg Black To: Giorgos Keramidas References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002081928.GA21439@gothmog.gr> <20041002083336.GA10355@k7.mavetju> <415E6C4A.1010804@gamersimpact.com> <20041002101842.GA23272@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002101842.GA23272@gothmog.gr> User-Agent: Mutt/1.4.2.1i; gjb-muttsend.sh 1.5 2003-10-01 X-Uptime: 37 days X-Operating-System: FreeBSD 4.8-RELEASE i386 X-Location: Brisbane, Australia; 27.49841S 152.98439E X-URL: http://www.gbch.net/gjb.html X-Blog: http://www.gbch.net/gjb/blog/ X-Image-URL: http://www.gbch.net/gjb/gjb-auug048.gif X-PGP-Key-Fingerprint: EBB2 2A92 A79D 1533 AC00 3C46 5D83 B6FB 4B04 B7D6 X-Request-PGP: http://www.gbch.net/keys/4B04B7D6.asc cc: Ryan Sommers cc: freebsd-hackers@freebsd.org cc: Max Laier Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 10:57:20 -0000 On 2004-10-02, Giorgos Keramidas wrote: > I liked what Max Laier proposed though, about making this tunable and > defaulting to off. See below for the behavior of what I've come up with: > > On 2004-10-02 11:23, Max Laier wrote: > > [ Sorry to be so negative ... ] > > > > At very least you should consider to error out silently as POSIX > > requires "-f" to be silent. Other than that you should really look > > into the standards and what they way about rm and friends. > > Agreed. Thanks for the feedback. Positive replies are not the only > sort that are worth a lot :-) Interesting -- if POSIX requires -f to be silent, we have quite a bit of work to do, as our rm is not silent in several cases of failure. And, while checking this, it wold be good to see what the standards say about exit values -- some errors are silent and return 0; others are noisy and return 1; there may be other possibilities, but I haven't checked exhaustively. As for protecting against "rm -rf / foo" as a typo for "rm -rf /foo", I don't mind if we offer protection against that; but I see no reason at all to "protect" root from "rm -rf /". It's fair to say that somebody who types that means it, and it's fair to go as far as we can in satisfying it. In any case, the new behaviour should only kick in if some environment variable is set and should not require doubled -f options. We all know how rm works and it's not broken. Greg From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 11:22: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 1500C16A4CE; Sat, 2 Oct 2004 11:22:55 +0000 (GMT) Received: from shrike.submonkey.net (cpc2-cdif3-6-0-cust204.cdif.cable.ntl.com [81.103.67.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id BD27743D4C; Sat, 2 Oct 2004 11:22:54 +0000 (GMT) (envelope-from setantae@submonkey.net) Received: from setantae by shrike.submonkey.net with local (Exim 4.42 (FreeBSD)) id 1CDhyX-000HaT-9O; Sat, 02 Oct 2004 12:22:53 +0100 Date: Sat, 2 Oct 2004 12:22:53 +0100 From: Ceri Davies To: Max Laier Message-ID: <20041002112253.GS2493@submonkey.net> Mail-Followup-To: Ceri Davies , Max Laier , freebsd-hackers@freebsd.org, Giorgos Keramidas References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XfgxuImQih7pKHD1" Content-Disposition: inline In-Reply-To: <200410021123.59811.max@love2party.net> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.6i Sender: Ceri Davies cc: freebsd-hackers@freebsd.org cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 11:22:55 -0000 --XfgxuImQih7pKHD1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 02, 2004 at 11:23:52AM +0200, Max Laier wrote: > [ Sorry to be so negative ... ] >=20 > At very least you should consider to error out silently as POSIX requires= "-f"=20 > to be silent. Other than that you should really look into the standards a= nd=20 > what they way about rm and friends. Are you sure? From the RATIONALE section of http://www.opengroup.org/onlinepubs/009695399/utilities/rm.html: "It is less clear that error messages regarding files that cannot be unlinked (removed) should be suppressed. Although this is historical practice, this volume of IEEE Std 1003.1-2001 does not permit the -f option to suppress such messages." > I am not a fan of providing seat belts like this. People concerned about = this,=20 > can "alias rm 'rm -i'" etc. etc. Others have commented like this ... >=20 > If you still have to make this change, make it tuneable with a environmen= t=20 > variable (and make it default to off). I'd prefer that too. Ceri --=20 It is not tinfoil, it is my new skin. I am a robot. --XfgxuImQih7pKHD1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXo+NocfcwTS3JF8RAtNeAJ4tMPCj5grbkW1fhPa2TetVoPaUZQCfVPV4 SJtwEKtxygDeLnrtBvC/jSI= =TooE -----END PGP SIGNATURE----- --XfgxuImQih7pKHD1-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 11:26: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 A0A4B16A4CE; Sat, 2 Oct 2004 11:26:09 +0000 (GMT) Received: from shrike.submonkey.net (cpc2-cdif3-6-0-cust204.cdif.cable.ntl.com [81.103.67.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60E5B43D1D; Sat, 2 Oct 2004 11:26:09 +0000 (GMT) (envelope-from setantae@submonkey.net) Received: from setantae by shrike.submonkey.net with local (Exim 4.42 (FreeBSD)) id 1CDi1g-000Hc1-Mr; Sat, 02 Oct 2004 12:26:08 +0100 Date: Sat, 2 Oct 2004 12:26:08 +0100 From: Ceri Davies To: Giorgos Keramidas Message-ID: <20041002112608.GT2493@submonkey.net> Mail-Followup-To: Ceri Davies , Giorgos Keramidas , Michael Reifenberger , freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wlp6b3zZ5qAEpghO" Content-Disposition: inline In-Reply-To: <20041002085143.GA52519@gothmog.gr> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.6i Sender: Ceri Davies cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 11:26:09 -0000 --wlp6b3zZ5qAEpghO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 02, 2004 at 11:51:43AM +0300, Giorgos Keramidas wrote: > Adding protection that prevents foot-shooting is not something without > precedent to FreeBSD either: > http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/boot0cfg/boot0cfg.c.di= ff?r1=3D1.13&r2=3D1.14 Is that the correct reference? Ceri --=20 It is not tinfoil, it is my new skin. I am a robot. --wlp6b3zZ5qAEpghO Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXpBQocfcwTS3JF8RAnlEAJ9lLqqZX2KmMFEBMFNK68Iq9V7+4gCghfln CkMGcjtZ0XeQ29bT2dyxB+c= =vG5H -----END PGP SIGNATURE----- --wlp6b3zZ5qAEpghO-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 11:51: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 C43D116A4CE; Sat, 2 Oct 2004 11:51:27 +0000 (GMT) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D48A43D2D; Sat, 2 Oct 2004 11:51:27 +0000 (GMT) (envelope-from max@love2party.net) Received: from [212.227.126.205] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1CDiQ0-0002KK-00; Sat, 02 Oct 2004 13:51:16 +0200 Received: from [217.227.153.30] (helo=donor.laier.local) by mrelayng.kundenserver.de with asmtp (TLSv1:RC4-MD5:128) (Exim 3.35 #1) id 1CDiPz-0001aZ-00; Sat, 02 Oct 2004 13:51:16 +0200 From: Max Laier To: Ceri Davies , freebsd-hackers@freebsd.org, Giorgos Keramidas Date: Sat, 2 Oct 2004 13:50:14 +0200 User-Agent: KMail/1.7 References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002112253.GS2493@submonkey.net> In-Reply-To: <20041002112253.GS2493@submonkey.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2479550.tlC6PqidFQ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200410021350.32888.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:61c499deaeeba3ba5be80f48ecc83056 Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 11:51:27 -0000 --nextPart2479550.tlC6PqidFQ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 02 October 2004 13:22, Ceri Davies wrote: > On Sat, Oct 02, 2004 at 11:23:52AM +0200, Max Laier wrote: > > [ Sorry to be so negative ... ] > > > > At very least you should consider to error out silently as POSIX requir= es > > "-f" to be silent. Other than that you should really look into the > > standards and what they way about rm and friends. > > Are you sure? From the RATIONALE section of > http://www.opengroup.org/onlinepubs/009695399/utilities/rm.html: > > "It is less clear that error messages regarding files that cannot be > unlinked (removed) should be suppressed. Although this is historical > practice, this volume of IEEE Std 1003.1-2001 does not permit the -f > option to suppress such messages." Misread - I stand corrected. > > I am not a fan of providing seat belts like this. People concerned about > > this, can "alias rm 'rm -i'" etc. etc. Others have commented like this > > ... > > > > If you still have to make this change, make it tuneable with a > > environment variable (and make it default to off). > > I'd prefer that too. > > Ceri =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2479550.tlC6PqidFQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQBBXpYIXyyEoT62BG0RAnp6AJ48vbeYwbblp2xHla4je7QP9ezLJQCffN5L gZaiIXhryp009aQAtae/1A0= =1mx8 -----END PGP SIGNATURE----- --nextPart2479550.tlC6PqidFQ-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 11:53: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 7A75516A4CE for ; Sat, 2 Oct 2004 11:53:06 +0000 (GMT) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3375043D3F for ; Sat, 2 Oct 2004 11:53:04 +0000 (GMT) (envelope-from joseph.koshy@gmail.com) Received: by mproxy.gmail.com with SMTP id 74so83899rnk for ; Sat, 02 Oct 2004 04:52:54 -0700 (PDT) Received: by 10.38.208.53 with SMTP id f53mr4213837rng; Sat, 02 Oct 2004 04:52:54 -0700 (PDT) Received: by 10.38.13.17 with HTTP; Sat, 2 Oct 2004 04:52:53 -0700 (PDT) Message-ID: <84dead72041002045246c13f55@mail.gmail.com> Date: Sat, 2 Oct 2004 11:52:53 +0000 From: Joseph Koshy To: Jason Osgerby In-Reply-To: <20041002075555.2466.qmail@web53209.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <200410020217.i922H8Tp006058@realtime.exit.com> <20041002075555.2466.qmail@web53209.mail.yahoo.com> cc: freebsd-hackers@freebsd.org Subject: Re: Amazing. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Joseph Koshy List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Oct 2004 11:53:06 -0000 jason> features, but whenever I tried to run startx after Xorg -configure had finished jason> running, the screen would flash then simply go back out to the console with the The X server's log (/var/log/X*.log) should tell you what went wrong. A common problem is that you are trying to run X without the appropriate permissions. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 11:48: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 11ED616A4CE for ; Sat, 2 Oct 2004 11:48:49 +0000 (GMT) Received: from miranda.expro.pl (mail2.expro.pl [193.25.166.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id 954D343D58 for ; Sat, 2 Oct 2004 11:48:48 +0000 (GMT) (envelope-from winfried@miranda.expro.pl) Received: by miranda.expro.pl (Postfix, from userid 1001) id E9CE9153F7; Sat, 2 Oct 2004 13:48:46 +0200 (CEST) Date: Sat, 2 Oct 2004 13:48:46 +0200 From: Jan Srzednicki To: hackers@freebsd.org Message-ID: <20041002114846.GA23339@miranda.expro.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Mailman-Approved-At: Sat, 02 Oct 2004 12:28:50 +0000 Subject: Wired memory monitoring 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, 02 Oct 2004 11:48:49 -0000 Hello, I am investigating some VM issues on FreeBSD. I have noticed that wired memory grows quite rapidly on forking lots of processes. After those processes exit, it drops a bit, but still can use about 100MB after launching 3000 processes. I think it's not a leak, as subsequent forks don't cause it to grow noticeably. I'm rather curious what eats all that memory. sysctl vm.zone shows some high values, but they're are not high in memory usage terms, even considering 50% (or so) efficiency of the slab allocator. The question is, are there any other memory inspecting tools that would allow me to see where is all that wired memory? And, are there any ways to control it's behaviour (eg. to free unused per-process structures and data)? greetings, -- Jan 'Winfried' Srzednicki w@expro.pl From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 12:43: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 6AE0D16A4CE; Sat, 2 Oct 2004 12:43:54 +0000 (GMT) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABCF643D45; Sat, 2 Oct 2004 12:43:53 +0000 (GMT) (envelope-from PeterJeremy@optushome.com.au) Received: from cirb503493.alcatel.com.au (c211-30-75-229.belrs2.nsw.optusnet.com.au [211.30.75.229]) i92Choov014286 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 2 Oct 2004 22:43:51 +1000 Received: from cirb503493.alcatel.com.au (localhost.alcatel.com.au [127.0.0.1])i92ChoxP022473; Sat, 2 Oct 2004 22:43:50 +1000 (EST) (envelope-from pjeremy@cirb503493.alcatel.com.au) Received: (from pjeremy@localhost)i92ChnTK022472; Sat, 2 Oct 2004 22:43:49 +1000 (EST) (envelope-from pjeremy) Date: Sat, 2 Oct 2004 22:43:49 +1000 From: Peter Jeremy To: Giorgos Keramidas Message-ID: <20041002124349.GA21569@cirb503493.alcatel.com.au> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002085143.GA52519@gothmog.gr> User-Agent: Mutt/1.4.2i cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 12:43:54 -0000 On Sat, 2004-Oct-02 11:51:43 +0300, Giorgos Keramidas wrote: >The reason I liked this idea is that root has zillions of other ways to >destroy an entire system, but not many of them are likely to be the >result of mistyping a single character as shown below: > > # rm -fr / home/someuser/* I've had a customer write a cronjob that did almost exactly this. He managed to 'test' it on all the (redundant) production systems as well as the test model. We were only called in when he found that there were some unexpected console messages and the systems wouldn't boot when he pressed the reset button. Luckily it managed to kill itself before it destroyed all the evidence (since the culprit initially denied doing anything). Based on that, I'm definitely in favour of some anti-foot-shooting measures. I don't think it should fail quietly: If I ask the computer to do something (stupid or not), it should either do it or tell me that it hasn't done it. Failing to do what I ask and not telling me means that I can't trust the computer - I have to double-check that the files I wanted to delete have actually gone away. -- Peter Jeremy From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 13:35: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 4C04116A4CF for ; Sat, 2 Oct 2004 13:35:17 +0000 (GMT) Received: from nerve.riss-telecom.ru (nerve.riss-telecom.ru [80.66.65.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5245143D2F for ; Sat, 2 Oct 2004 13:35:16 +0000 (GMT) (envelope-from frol@nerve.riss-telecom.ru) Received: from nerve.riss-telecom.ru (localhost [127.0.0.1]) i92DZCVQ017144 for ; Sat, 2 Oct 2004 20:35:12 +0700 (NOVST) (envelope-from frol@nerve.riss-telecom.ru) Received: (from frol@localhost) by nerve.riss-telecom.ru (8.12.10/8.12.10/Submit) id i92DZCYR017143 for hackers@freebsd.org; Sat, 2 Oct 2004 20:35:12 +0700 (NOVST) (envelope-from frol) Date: Sat, 2 Oct 2004 20:35:12 +0700 From: Dmitry Frolov To: hackers@freebsd.org Message-ID: <20041002133512.GA16646@nerve.riss-telecom.ru> References: <415BDFC2.1020304@fer.hr> <415C9967.3090309@jonny.eng.br> <415D2E86.5060007@fer.hr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <415D2E86.5060007@fer.hr> Organization: RISS-Telecom, JSC X-PGP-Fingerprint: 5232 98E7 596E 21C2 52B5 FCAE 8088 3F87 88BC 27B0 User-Agent: Mutt/1.5.1i Subject: Re: GEOM (ggate) compression consumer +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, 02 Oct 2004 13:35:17 -0000 * Ivan Voras [01.10.2004 17:17]: > But, I still can't solve the wdrain problem. I've tried it on a recent > BETA6 kernel and it still remains. Writes get slower and slower > (actually, the frequency of writes), and then something locks up (with > no CPU usage...). Sometimes, *any* writes to any filesystem lock up. Looks very similar to a syncing problem found in md(4). Take a look at cvs log entry for revision 1.115 of md.c: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/md/md.c wbr&w, dmitry. -- Dmitry Frolov RISS-Telecom Network, Novosibirsk, Russia 66415911@ICQ, +7 3832 NO WA1T, DVF-RIPE From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 14:49:05 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 0EF7716A4CE; Sat, 2 Oct 2004 14:49:05 +0000 (GMT) Received: from tensor.xs4all.nl (tensor.xs4all.nl [194.109.160.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98B3643D46; Sat, 2 Oct 2004 14:49:04 +0000 (GMT) (envelope-from dimitry@andric.com) Received: from kilgore.dim (kilgore.dim [192.168.0.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.xs4all.nl (Postfix) with ESMTP id 5AE2A2284E; Sat, 2 Oct 2004 16:49:02 +0200 (CEST) Date: Sat, 2 Oct 2004 16:48:46 +0200 From: Dimitry Andric X-Mailer: The Bat! (v3.0.1 RC3) Professional X-Priority: 3 (Normal) Message-ID: <1221615358.20041002164846@andric.com> To: Giorgos Keramidas In-Reply-To: <20041002081928.GA21439@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="pgp-sha1"; boundary="----------10A17715E3C37CADC" cc: freebsd-hackers@FreeBSD.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 14:49:05 -0000 ------------10A17715E3C37CADC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On 2004-10-02 at 10:19:28 Giorgos Keramidas wrote: > His idea was remarkably simple, so I went ahead and wrote this patch for > rm(1) of FreeBSD: Of course, your work is commendable, but isn't is much simpler to just not type commands like that? I mean, "rm -rf /etc" or "rm -rf /bin" are just as bad, but do you really want to be checking for all possible `bad' deletions? That way, we'll start to look like some software from Redmond... :) ------------10A17715E3C37CADC Content-Type: application/pgp-signature -----BEGIN PGP MESSAGE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFBXr/OsF6jCi4glqMRAlX4AJ47zKAfHavaUWrcMeBHemX3VV5ZjgCfYC/S aX3HDqLusRv85EICbzTfyeg= =37Pi -----END PGP MESSAGE----- ------------10A17715E3C37CADC-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 15:01: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 79FFC16A4CE; Sat, 2 Oct 2004 15:01:13 +0000 (GMT) Received: from lara.cc.fer.hr (lara.cc.fer.hr [161.53.72.113]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA0D243D49; Sat, 2 Oct 2004 15:01:12 +0000 (GMT) (envelope-from ivoras@fer.hr) Received: from [127.0.0.1] (localhost.cc.fer.hr [127.0.0.1]) by lara.cc.fer.hr (8.13.1/8.13.1) with ESMTP id i92F0SsZ000753; Sat, 2 Oct 2004 17:00:28 +0200 (CEST) (envelope-from ivoras@fer.hr) Message-ID: <415EC28B.4030900@fer.hr> Date: Sat, 02 Oct 2004 17:00:27 +0200 From: Ivan Voras User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: hackers@freebsd.org, current@freebsd.org References: <415BDFC2.1020304@fer.hr> <415C9967.3090309@jonny.eng.br> <415D2E86.5060007@fer.hr> <20041002133512.GA16646@nerve.riss-telecom.ru> In-Reply-To: <20041002133512.GA16646@nerve.riss-telecom.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: GEOM (ggate) compression consumer +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, 02 Oct 2004 15:01:13 -0000 Dmitry Frolov wrote: > * Ivan Voras [01.10.2004 17:17]: > >>But, I still can't solve the wdrain problem. I've tried it on a recent >>BETA6 kernel and it still remains. Writes get slower and slower >>(actually, the frequency of writes), and then something locks up (with >>no CPU usage...). Sometimes, *any* writes to any filesystem lock up. > > > Looks very similar to a syncing problem found in md(4). > Take a look at cvs log entry for revision 1.115 of md.c: > > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/md/md.c Thank you! It's exactly the same problem I've got. After including O_DIRECT and O_FSYNC flags to the open() call, the problems dissapear (though performance takes a big hit). Also, it's the same problem with ggatel. This small patch solves it: --- ggatel.c.old Sat Oct 2 16:48:08 2004 +++ ggatel.c Sat Oct 2 16:48:11 2004 @@ -160,7 +160,7 @@ struct g_gate_ctl_create ggioc; int fd; - fd = open(path, g_gate_openflags(flags)); + fd = open(path, g_gate_openflags(flags) | O_DIRECT | O_FSYNC); if (fd < 0) err(EXIT_FAILURE, "Cannot open %s", path); ggioc.gctl_version = G_GATE_VERSION; I've poslihed some quirks from the ggatec, so it should now be ready for somewhat broader testing ;) (It's at http://ivoras.sharanet.org/ggcomp.tgz ; expect about 10x worse performance compared to performance without compression). From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 15:03: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 3985F16A4CE for ; Sat, 2 Oct 2004 15:03:39 +0000 (GMT) Received: from smtp.uol.com.br (smtpout6.uol.com.br [200.221.11.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id 50C6243D1F for ; Sat, 2 Oct 2004 15:03:38 +0000 (GMT) (envelope-from jonny@jonny.eng.br) Received: from [200.217.22.85] (200217022085.user.veloxzone.com.br [200.217.22.85]) by scorpion6.uol.com.br (Postfix) with ESMTP id 8B1288A20 for ; Sat, 2 Oct 2004 12:03:36 -0300 (BRT) Message-ID: <415EC35E.6050602@jonny.eng.br> Date: Sat, 02 Oct 2004 12:03:58 -0300 From: =?ISO-8859-1?Q?Jo=E3o_Carlos_Mendes_Lu=EDs?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: pt-br, en-us, en, pt MIME-Version: 1.0 To: hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Probing PCI devices not detected by BIOS 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, 02 Oct 2004 15:03:39 -0000 Hi, In FreeBSD 4.x, is there an option to probe PCI devices not detected by BIOS? My problem: I have an old ASUS P2B-DS motherboard based server, and want to use a Realtek 8169 Gigabit LAN Card with it. But the BIOS does not detect the LAN card, I don't know why. If I put the card in another computer, it is detected perfectly. Unless this is a hardware incompatibility problem, I would expect FreeBSD to do a better job than the old BIOS. I would rather have an Intel card, but they not available around. :-( Jonny -- João Carlos Mendes Luís - Networking Engineer - jonny@jonny.eng.br From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 15:03: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 F281516A4CE; Sat, 2 Oct 2004 15:03:51 +0000 (GMT) Received: from zaphod.nitro.dk (port324.ds1-khk.adsl.cybercity.dk [212.242.113.79]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4879E43D1D; Sat, 2 Oct 2004 15:03:51 +0000 (GMT) (envelope-from simon@zaphod.nitro.dk) Received: by zaphod.nitro.dk (Postfix, from userid 3000) id 17CCF119AF; Sat, 2 Oct 2004 17:03:50 +0200 (CEST) Date: Sat, 2 Oct 2004 17:03:50 +0200 From: "Simon L. Nielsen" To: Dimitry Andric Message-ID: <20041002150349.GB769@zaphod.nitro.dk> References: <20041002081928.GA21439@gothmog.gr> <1221615358.20041002164846@andric.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SkvwRMAIpAhPCcCJ" Content-Disposition: inline In-Reply-To: <1221615358.20041002164846@andric.com> User-Agent: Mutt/1.5.6i cc: freebsd-hackers@FreeBSD.org cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 15:03:52 -0000 --SkvwRMAIpAhPCcCJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2004.10.02 16:48:46 +0200, Dimitry Andric wrote: > On 2004-10-02 at 10:19:28 Giorgos Keramidas wrote: >=20 > > His idea was remarkably simple, so I went ahead and wrote this patch for > > rm(1) of FreeBSD: >=20 > Of course, your work is commendable, but isn't is much simpler to just > not type commands like that? I mean, "rm -rf /etc" or "rm -rf /bin" > are just as bad, but do you really want to be checking for all > possible `bad' deletions? That way, we'll start to look like some > software from Redmond... :) As keramida has noted this particular case is more likely to be made by mistake than many others, e.g. by doing "rm -rf / foo/bar" where "rm -rf /foo/bar/" was meant. Therefor I really think keramidas _optional_ foot-shooting feature is a nice thing. I know I will enable it on my systems if it's committed, and probably keep it as a local patch if not. --=20 Simon L. Nielsen FreeBSD Bikeshed Team --SkvwRMAIpAhPCcCJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXsNVh9pcDSc1mlERAr39AJ4tOLw13oorXmJS5Lle0gLcb5AyaACePLLu OCGYmslYaacUGmEV6Bb01nc= =ElGg -----END PGP SIGNATURE----- --SkvwRMAIpAhPCcCJ-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 15:10: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 4EBA116A4CE for ; Sat, 2 Oct 2004 15:10:49 +0000 (GMT) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB48F43D1F for ; Sat, 2 Oct 2004 15:10:48 +0000 (GMT) (envelope-from sean-freebsd@farley.org) Received: from thor.farley.org (idwprlayki79lzw3@thor.farley.org [IPv6:2002:4340:5fcd:1::5]) by mail.farley.org (8.12.11/8.12.11) with ESMTP id i92FAlvf008796; Sat, 2 Oct 2004 10:10:47 -0500 (CDT) (envelope-from sean-freebsd@farley.org) Received: from thor.farley.org (localhost [127.0.0.1]) by thor.farley.org (8.13.1/8.13.1) with ESMTP id i92FAlKg006662; Sat, 2 Oct 2004 10:10:47 -0500 (CDT) (envelope-from sean-freebsd@farley.org) Received: from localhost (sean@localhost)i92FAkp0006659; Sat, 2 Oct 2004 10:10:47 -0500 (CDT) (envelope-from sean-freebsd@farley.org) X-Authentication-Warning: thor.farley.org: sean owned process doing -bs Date: Sat, 2 Oct 2004 10:10:46 -0500 (CDT) From: Sean Farley X-X-Sender: sean@thor.farley.org To: Jim Durham In-Reply-To: <200409301003.00492.durham@jcdurham.com> Message-ID: <20041002095910.Y4180@thor.farley.org> References: <200409301003.00492.durham@jcdurham.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots 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, 02 Oct 2004 15:10:49 -0000 On Thu, 30 Sep 2004, Jim Durham wrote: > I have had this problem now with at least 3 FreeBSD servers over a > period of about 2 years. I had put it down to some hardware problem > but it seems to be too much of a coincidence with 3 different machines > doing the same thing. I had sudden reboots over a period of two years. Recently, they started happening more often. It turned out that the capacitors had gone bad. Capacitors from about two to three years ago used a poor formula. This site has information about it: http://www.badcaps.net/. The interesting thing for me was that the capacitors did not show any signs for about two years. They looked like they had flat tops without leaking. I think they may have spilled their guts when, I turned the computer off for about a week for a vacation. They must have missed me. :) In case the power supplies are over-taxed, here is an on-line calculator: http://takaman.jp/D/index.html?english. Sean ----------------------- sean-freebsd@farley.org From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 15:42: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 F175816A4CE for ; Sat, 2 Oct 2004 15:42:18 +0000 (GMT) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 87E1643D1F for ; Sat, 2 Oct 2004 15:42:18 +0000 (GMT) (envelope-from sean-freebsd@farley.org) Received: from thor.farley.org (kz63m46dae3mo26d@thor.farley.org [IPv6:2002:4340:5fcd:1::5]) by mail.farley.org (8.12.11/8.12.11) with ESMTP id i92FgHDp009154 for ; Sat, 2 Oct 2004 10:42:17 -0500 (CDT) (envelope-from sean-freebsd@farley.org) Received: from thor.farley.org (localhost [127.0.0.1]) by thor.farley.org (8.13.1/8.13.1) with ESMTP id i92FgH6D006865 for ; Sat, 2 Oct 2004 10:42:17 -0500 (CDT) (envelope-from sean-freebsd@farley.org) Received: from localhost (sean@localhost)i92FgHqj006862 for ; Sat, 2 Oct 2004 10:42:17 -0500 (CDT) (envelope-from sean-freebsd@farley.org) X-Authentication-Warning: thor.farley.org: sean owned process doing -bs Date: Sat, 2 Oct 2004 10:42:16 -0500 (CDT) From: Sean Farley X-X-Sender: sean@thor.farley.org To: freebsd-hackers@freebsd.org In-Reply-To: <200410021123.59811.max@love2party.net> Message-ID: <20041002102430.Y5481@thor.farley.org> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 15:42:19 -0000 On Sat, 2 Oct 2004, Max Laier wrote: > At very least you should consider to error out silently as POSIX > requires "-f" to be silent. Other than that you should really look > into the standards and what they way about rm and friends. Personally, I would want it to throw an error for the exit, but I do not know the standard. > I am not a fan of providing seat belts like this. People concerned > about this, can "alias rm 'rm -i'" etc. etc. Others have commented > like this ... Seat belts that prevent a destructive action that may be desired only .0000001% (or much less) of the time do not bother me especially when the action is from a common tool. If the tool was rarely used (i.e., fdisk), or the action was desired much more often, then I could see a complaint about it. I already have that alias; -f overrides -i. It would drive me crazy for it to not override -i. Solaris does not allow -f to override -i and will ask for everything you want to delete recursively. I had to always type '/bin/rm -rf ' to go around this. Highly annoying. > If you still have to make this change, make it tuneable with a > environment variable (and make it default to off). Why not default on? root will not run 'rm -rf /' on purpose very often. Once will be enough. :) Also, when and why would someone want to do this? Sean ----------------------- sean-freebsd@farley.org From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 15:54: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 CEAFA16A4CE; Sat, 2 Oct 2004 15:54:50 +0000 (GMT) Received: from athena.softcardsystems.com (mail.softcardsystems.com [12.34.136.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E0E243D2F; Sat, 2 Oct 2004 15:54:50 +0000 (GMT) (envelope-from sah@softcardsystems.com) Received: from athena (athena [12.34.136.114])i92Grm0E025850; Sat, 2 Oct 2004 11:53:48 -0500 Date: Sat, 2 Oct 2004 11:53:48 -0500 (EST) From: Sam X-X-Sender: sah@athena To: Michael Reifenberger In-Reply-To: <20041002102918.W22102@fw.reifenberger.com> Message-ID: References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: freebsd-hackers@freebsd.org cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 15:54:50 -0000 > This is UNIX, not Windows. Agreed -- besides, it's only a matter of time before this and fourteen other -f related flags are incorporated into the gnu rm. Use it if you've got a problem with simple tools that do what you ask them to. Sam From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 16:06: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 951F216A4CE for ; Sat, 2 Oct 2004 16:06:13 +0000 (GMT) Received: from node15.coopprint.com (node15.cooperativeprinting.com [208.4.77.15]) by mx1.FreeBSD.org (Postfix) with SMTP id DA53143D45 for ; Sat, 2 Oct 2004 16:06:12 +0000 (GMT) (envelope-from ryans@gamersimpact.com) Received: (qmail 50875 invoked by uid 0); 2 Oct 2004 16:05:41 -0000 Received: from unknown (HELO ?192.168.0.5?) (63.231.165.205) by node15.coopprint.com with SMTP; 2 Oct 2004 16:05:41 -0000 Message-ID: <415ED1F8.7030705@gamersimpact.com> Date: Sat, 02 Oct 2004 11:06:16 -0500 From: Ryan Sommers User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jan Srzednicki References: <20041002114846.GA23339@miranda.expro.pl> In-Reply-To: <20041002114846.GA23339@miranda.expro.pl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: hackers@freebsd.org Subject: Re: Wired memory monitoring 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, 02 Oct 2004 16:06:13 -0000 Jan Srzednicki wrote: >Hello, > >I am investigating some VM issues on FreeBSD. I have noticed that wired >memory grows quite rapidly on forking lots of processes. After those >processes exit, it drops a bit, but still can use about 100MB after >launching 3000 processes. I think it's not a leak, as subsequent forks >don't cause it to grow noticeably. > >I'm rather curious what eats all that memory. sysctl vm.zone shows some >high values, but they're are not high in memory usage terms, even >considering 50% (or so) efficiency of the slab allocator. > >The question is, are there any other memory inspecting tools that would >allow me to see where is all that wired memory? And, are there any ways >to control it's behaviour (eg. to free unused per-process structures and >data)? > >greetings, > > Wouldn't that be the zone allocator grabbing pages from the free list and adding them to non-pagable per process structures? -- Ryan Sommers ryans@gamersimpact.com From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 16:46:44 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 AE47616A4CE; Sat, 2 Oct 2004 16:46:44 +0000 (GMT) Received: from gw.celabo.org (gw.celabo.org [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5FE1C43D4C; Sat, 2 Oct 2004 16:46:44 +0000 (GMT) (envelope-from nectar@celabo.org) Received: from localhost (localhost [127.0.0.1]) by gw.celabo.org (Postfix) with ESMTP id F2A0A5487F; Sat, 2 Oct 2004 11:46:41 -0500 (CDT) Received: from gw.celabo.org ([127.0.0.1]) by localhost (hellblazer.celabo.org [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 64148-05; Sat, 2 Oct 2004 11:46:30 -0500 (CDT) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (not verified)) by gw.celabo.org (Postfix) with ESMTP id 80F5B5485D; Sat, 2 Oct 2004 11:46:21 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id D61066D466; Sat, 2 Oct 2004 11:46:07 -0500 (CDT) Date: Sat, 2 Oct 2004 11:46:07 -0500 From: "Jacques A. Vidrine" To: Peter Jeremy Message-ID: <20041002164607.GD90985@madman.celabo.org> Mail-Followup-To: "Jacques A. Vidrine" , Peter Jeremy , Giorgos Keramidas , freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <20041002124349.GA21569@cirb503493.alcatel.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002124349.GA21569@cirb503493.alcatel.com.au> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.6i cc: freebsd-hackers@freebsd.org cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 16:46:44 -0000 On Sat, Oct 02, 2004 at 10:43:49PM +1000, Peter Jeremy wrote: > I've had a customer write a cronjob that did almost exactly this. > He managed to 'test' it on all the (redundant) production systems > as well as the test model. We were only called in when he found > that there were some unexpected console messages and the systems > wouldn't boot when he pressed the reset button. Luckily it > managed to kill itself before it destroyed all the evidence (since > the culprit initially denied doing anything). > > Based on that, I'm definitely in favour of some anti-foot-shooting > measures. [...] FWIW, I'm not in favor of adding ad-hoc "features" to handle edge-cases. ("feature" because this is actually introducing a bug :-) I picked this email to which to respond, because I can share my own stupidity. Case much like the one described above, but my cronjob included something like: cd /path/to/directory/with/temporary/files rm -fr * Only another admin removed `/path/to/directory/with/temporary/files'... so the `cd' failed and left the current directory as `/'. For some reason the system crashed :-) ... and then crashed again a few days after restoring from backup... doh! Will the next step be to prevent `rm -fr *' iff the current working directory is '/' ? Please explain your answer. :-) Cheers, -- Jacques A Vidrine / NTT/Verio nectar@celabo.org / jvidrine@verio.net / nectar@FreeBSD.org From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 16:51:56 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 0055E16A4CE for ; Sat, 2 Oct 2004 16:51:56 +0000 (GMT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id B196743D5A for ; Sat, 2 Oct 2004 16:51:55 +0000 (GMT) (envelope-from tillman@seekingfire.com) Received: by mail.seekingfire.com (Postfix, from userid 500) id 1F17E2D6; Sat, 2 Oct 2004 10:51:55 -0600 (CST) Date: Sat, 2 Oct 2004 10:51:55 -0600 From: Tillman Hodgson To: freebsd-hackers@freebsd.org Message-ID: <20041002165155.GP35869@seekingfire.com> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002102430.Y5481@thor.farley.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002102430.Y5481@thor.farley.org> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-GPG-Key-ID: 828AFC7B X-GPG-Fingerprint: 5584 14BA C9EB 1524 0E68 F543 0F0A 7FBC 828A FC7B X-GPG-Key: http://www.seekingfire.com/gpg_key.asc X-Urban-Legend: There is lots of hidden information in headers User-Agent: Mutt/1.5.6i Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 16:51:56 -0000 On Sat, Oct 02, 2004 at 10:42:16AM -0500, Sean Farley wrote: > Why not default on? root will not run 'rm -rf /' on purpose very often. > Once will be enough. :) Also, when and why would someone want to do > this? Exactly. Who would expect `rm -rf /` to actually succeed? It's not only dangerous, it doesn't work in a useful way ;-) If one is thinking about `rm -rf /`, `newfs` is probably the right answer. -T -- "I have the attention span of a strobe lit goldfish, please get to the point quickly!" -- Seen on Slashdot.org From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 16:54:03 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 C5CA716A4CE for ; Sat, 2 Oct 2004 16:54:03 +0000 (GMT) Received: from hotmail.com (bay2-f27.bay2.hotmail.com [65.54.247.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D83243D5E for ; Sat, 2 Oct 2004 16:54:03 +0000 (GMT) (envelope-from missive@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sat, 2 Oct 2004 09:54:02 -0700 Received: from 208.186.54.187 by by2fd.bay2.hotmail.msn.com with HTTP; Sat, 02 Oct 2004 16:53:50 GMT X-Originating-IP: [208.186.54.187] X-Originating-Email: [missive@hotmail.com] X-Sender: missive@hotmail.com From: "Lee Harr" To: freebsd-hackers@freebsd.org Date: Sat, 02 Oct 2004 21:23:50 +0430 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 02 Oct 2004 16:54:02.0835 (UTC) FILETIME=[6BB31A30:01C4A8A0] Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 16:54:03 -0000 >John Beck, who works for Sun, has posted an entry in his blog yesterday >about "rm -fr /" protection, which I liked a lot: >http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > >His idea was remarkably simple, so I went ahead and wrote this patch for >rm(1) of FreeBSD: > How about: chflags sunlnk / ? _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 16:55: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 634CB16A4E2 for ; Sat, 2 Oct 2004 16:55:37 +0000 (GMT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80E9D43D5E for ; Sat, 2 Oct 2004 16:55:32 +0000 (GMT) (envelope-from tillman@seekingfire.com) Received: by mail.seekingfire.com (Postfix, from userid 500) id 2F2F32D6; Sat, 2 Oct 2004 10:55:32 -0600 (CST) Date: Sat, 2 Oct 2004 10:55:32 -0600 From: Tillman Hodgson To: freebsd-hackers@freebsd.org Message-ID: <20041002165532.GQ35869@seekingfire.com> References: <20041002081928.GA21439@gothmog.gr> <1221615358.20041002164846@andric.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1221615358.20041002164846@andric.com> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-GPG-Key-ID: 828AFC7B X-GPG-Fingerprint: 5584 14BA C9EB 1524 0E68 F543 0F0A 7FBC 828A FC7B X-GPG-Key: http://www.seekingfire.com/gpg_key.asc X-Urban-Legend: There is lots of hidden information in headers User-Agent: Mutt/1.5.6i Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 16:55:37 -0000 On Sat, Oct 02, 2004 at 04:48:46PM +0200, Dimitry Andric wrote: > Of course, your work is commendable, but isn't is much simpler to just > not type commands like that? I mean, "rm -rf /etc" or "rm -rf /bin" > are just as bad, but do you really want to be checking for all > possible `bad' deletions? That way, we'll start to look like some > software from Redmond... :) `rm -rf /etc` works the way one would expect (removes the etc branch of the filesystem tree). `rm -rf /` is a special case -- it's unlikely to succeed. Additionally, it's a common typo. If it doesn't do what an admin expects, and it's a common typo, removing the ability for it to fail by removing the ability for it to be used makes a lot of sense to me. -T -- Wisdom is not communicable. The wisdom which a wise man tries to communicate always sounds foolish. Hermann Hesse From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 17:10:56 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 65AF616A4CE; Sat, 2 Oct 2004 17:10:56 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9E65C43D1F; Sat, 2 Oct 2004 17:10:55 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b208.otenet.gr [212.205.244.216]) i92HArqv020921; Sat, 2 Oct 2004 20:10:53 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i92HAqwD002071; Sat, 2 Oct 2004 20:10:52 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i92HAqHd002070; Sat, 2 Oct 2004 20:10:52 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 20:10:52 +0300 From: Giorgos Keramidas To: "Jacques A. Vidrine" , Peter Jeremy , freebsd-hackers@freebsd.org Message-ID: <20041002171052.GA2000@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <20041002124349.GA21569@cirb503493.alcatel.com.au> <20041002164607.GD90985@madman.celabo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002164607.GD90985@madman.celabo.org> Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 17:10:56 -0000 On 2004-10-02 11:46, "Jacques A. Vidrine" wrote: > > Will the next step be to prevent `rm -fr *' iff the current working > directory is '/' ? Please explain your answer. :-) No. The fact * was passed is not visible to the running program. It's probably better to do this in the shell before it does the wildcard expansion, just like tcsh does. The "rm -fr / tmp/foo" case *is* visible to the running program though and is a lot easier to handle. I see a lot of people don't like the change, even though I made it default to off and controlled by an environment variable. There's no reason to keep pushing for it, then. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 17: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 A227D16A4D1 for ; Sat, 2 Oct 2004 17:55:25 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A53A43D2F for ; Sat, 2 Oct 2004 17:55:22 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b208.otenet.gr [212.205.244.216]) i92HtJjZ011612; Sat, 2 Oct 2004 20:55:20 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i92HtIUK002271; Sat, 2 Oct 2004 20:55:18 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i92HtHtL002270; Sat, 2 Oct 2004 20:55:17 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 20:55:17 +0300 From: Giorgos Keramidas To: Tillman Hodgson Message-ID: <20041002175517.GA2230@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002102430.Y5481@thor.farley.org> <20041002165155.GP35869@seekingfire.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002165155.GP35869@seekingfire.com> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 17:55:25 -0000 On 2004-10-02 10:51, Tillman Hodgson wrote: > On Sat, Oct 02, 2004 at 10:42:16AM -0500, Sean Farley wrote: > > Why not default on? root will not run 'rm -rf /' on purpose very often. > > Once will be enough. :) Also, when and why would someone want to do > > this? > > Exactly. Who would expect `rm -rf /` to actually succeed? It's not only > dangerous, it doesn't work in a useful way ;-) > > If one is thinking about `rm -rf /`, `newfs` is probably the right > answer. And a hell of a lot faster too. This is the *only* reason why I initially wrote this. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 17:57:07 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 EC02216A4CE for ; Sat, 2 Oct 2004 17:57:07 +0000 (GMT) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09CF443D39 for ; Sat, 2 Oct 2004 17:57:07 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b208.otenet.gr [212.205.244.216]) i92Hv4OZ026341; Sat, 2 Oct 2004 20:57:05 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i92Hv4NS002290; Sat, 2 Oct 2004 20:57:04 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i92Hv4lp002289; Sat, 2 Oct 2004 20:57:04 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 2 Oct 2004 20:57:04 +0300 From: Giorgos Keramidas To: Lee Harr Message-ID: <20041002175704.GB2230@gothmog.gr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 17:57:08 -0000 On 2004-10-02 21:23, Lee Harr wrote: > >John Beck, who works for Sun, has posted an entry in his blog yesterday > >about "rm -fr /" protection, which I liked a lot: > >http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > > >His idea was remarkably simple, so I went ahead and wrote this patch for > >rm(1) of FreeBSD: > > How about: > > chflags sunlnk / > ? Setting sunlink on / will only protect the / directory, not its descendants, so you don't gain much. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 18:09: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 C8FF516A4CE for ; Sat, 2 Oct 2004 18:09:24 +0000 (GMT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73DCE43D2D for ; Sat, 2 Oct 2004 18:09:24 +0000 (GMT) (envelope-from tillman@seekingfire.com) Received: by mail.seekingfire.com (Postfix, from userid 500) id 264542D6; Sat, 2 Oct 2004 12:09:24 -0600 (CST) Date: Sat, 2 Oct 2004 12:09:24 -0600 From: Tillman Hodgson To: freebsd-hackers@freebsd.org Message-ID: <20041002180924.GR35869@seekingfire.com> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002102430.Y5481@thor.farley.org> <20041002165155.GP35869@seekingfire.com> <20041002175517.GA2230@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002175517.GA2230@gothmog.gr> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-GPG-Key-ID: 828AFC7B X-GPG-Fingerprint: 5584 14BA C9EB 1524 0E68 F543 0F0A 7FBC 828A FC7B X-GPG-Key: http://www.seekingfire.com/gpg_key.asc X-Urban-Legend: There is lots of hidden information in headers User-Agent: Mutt/1.5.6i Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 18:09:24 -0000 On Sat, Oct 02, 2004 at 08:55:17PM +0300, Giorgos Keramidas wrote: > On 2004-10-02 10:51, Tillman Hodgson wrote: > > If one is thinking about `rm -rf /`, `newfs` is probably the right > > answer. > > And a hell of a lot faster too. Exactly. > This is the *only* reason why I initially wrote this. I'd love to see it incorporated. -T -- To imagine a human world without ethics, but in which life goes well, it is necessary to suppose a golden age: a world without competition, or causes of strife, or clashing desires, or envy or malice. -- Simon Blackburn (Ruling Passions) From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 18:20: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 A20D316A4CE for ; Sat, 2 Oct 2004 18:20:29 +0000 (GMT) Received: from ylpvm43.prodigy.net (ylpvm43-ext.prodigy.net [207.115.57.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BEC643D1F for ; Sat, 2 Oct 2004 18:20:29 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-67-124-49-205.dsl.snfc21.pacbell.net [67.124.49.205])i92IIcCE023633; Sat, 2 Oct 2004 14:18:48 -0400 Message-ID: <415EF0F4.9060409@elischer.org> Date: Sat, 02 Oct 2004 11:18:28 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: Jan Srzednicki References: <20041002114846.GA23339@miranda.expro.pl> In-Reply-To: <20041002114846.GA23339@miranda.expro.pl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: hackers@freebsd.org Subject: Re: Wired memory monitoring 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, 02 Oct 2004 18:20:29 -0000 Jan Srzednicki wrote: > Hello, > > I am investigating some VM issues on FreeBSD. I have noticed that wired > memory grows quite rapidly on forking lots of processes. After those > processes exit, it drops a bit, but still can use about 100MB after > launching 3000 processes. I think it's not a leak, as subsequent forks > don't cause it to grow noticeably. > > I'm rather curious what eats all that memory. sysctl vm.zone shows some > high values, but they're are not high in memory usage terms, even > considering 50% (or so) efficiency of the slab allocator. > > The question is, are there any other memory inspecting tools that would > allow me to see where is all that wired memory? And, are there any ways > to control it's behaviour (eg. to free unused per-process structures and > data)? > > greetings, Every thread allocated only shows the thread structure in the zone stats but there is a 3 page stack allocated with it too which doesn't show up there. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 18:25: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 9771D16A4CE for ; Sat, 2 Oct 2004 18:25:28 +0000 (GMT) Received: from ylpvm15.prodigy.net (ylpvm15-ext.prodigy.net [207.115.57.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5911D43D1D for ; Sat, 2 Oct 2004 18:25:28 +0000 (GMT) (envelope-from julian@elischer.org) Received: from elischer.org (adsl-67-124-49-205.dsl.snfc21.pacbell.net [67.124.49.205])i92IPRqM003790; Sat, 2 Oct 2004 14:25:28 -0400 Message-ID: <415EF28E.4010502@elischer.org> Date: Sat, 02 Oct 2004 11:25:18 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4b) Gecko/20030524 X-Accept-Language: en, hu MIME-Version: 1.0 To: Julian Elischer References: <20041002114846.GA23339@miranda.expro.pl> <415EF0F4.9060409@elischer.org> In-Reply-To: <415EF0F4.9060409@elischer.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Jan Srzednicki cc: hackers@freebsd.org Subject: Re: Wired memory monitoring 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, 02 Oct 2004 18:25:28 -0000 Julian Elischer wrote: > Jan Srzednicki wrote: > >> Hello, >> >> I am investigating some VM issues on FreeBSD. I have noticed that wired >> memory grows quite rapidly on forking lots of processes. After those >> processes exit, it drops a bit, but still can use about 100MB after >> launching 3000 processes. I think it's not a leak, as subsequent forks >> don't cause it to grow noticeably. >> >> I'm rather curious what eats all that memory. sysctl vm.zone shows some >> high values, but they're are not high in memory usage terms, even >> considering 50% (or so) efficiency of the slab allocator. >> >> The question is, are there any other memory inspecting tools that would >> allow me to see where is all that wired memory? And, are there any ways >> to control it's behaviour (eg. to free unused per-process structures and >> data)? >> >> greetings, > > Every thread allocated only shows the thread structure in the zone stats > but there is a 3 page stack allocated with it too which doesn't show up > there. this is in 5.x & 6.x.. you don't say what version you are looking at. > > > _______________________________________________ > 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 Oct 2 18:38: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 E039D16A4DB for ; Sat, 2 Oct 2004 18:38:04 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C55943D3F for ; Sat, 2 Oct 2004 18:38:02 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i92IemKt088337; Sat, 2 Oct 2004 12:40:48 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i92Ieltl088334; Sat, 2 Oct 2004 12:40:47 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 2 Oct 2004 12:40:47 -0600 (MDT) From: Doug Russell To: Max Laier In-Reply-To: <200410021123.59811.max@love2party.net> Message-ID: <20041002123902.K88183-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 18:38:05 -0000 On Sat, 2 Oct 2004, Max Laier wrote: > I am not a fan of providing seat belts like this. People concerned about Neither am I. One of the best features of UNIX has always been that you can shoot yourself in the foot if you want to. If someone really wants seatbelts, they must be optional. Later...... From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 18:50: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 E157416A4CE; Sat, 2 Oct 2004 18:50:40 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9742443D31; Sat, 2 Oct 2004 18:50:40 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i92IouXG001177; Sat, 2 Oct 2004 14:50:56 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i92IotRr001176; Sat, 2 Oct 2004 14:50:55 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 2 Oct 2004 14:50:55 -0400 From: David Schultz To: Michael Reifenberger Message-ID: <20041002185055.GA1029@VARK.MIT.EDU> Mail-Followup-To: Michael Reifenberger , Giorgos Keramidas , freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002102918.W22102@fw.reifenberger.com> cc: freebsd-hackers@FreeBSD.ORG cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 18:50:41 -0000 On Sat, Oct 02, 2004, Michael Reifenberger wrote: > On Sat, 2 Oct 2004, Giorgos Keramidas wrote: > > >Date: Sat, 2 Oct 2004 11:19:28 +0300 > >From: Giorgos Keramidas > >To: freebsd-hackers@freebsd.org > >Subject: Protection from the dreaded "rm -fr /" > > > >John Beck, who works for Sun, has posted an entry in his blog yesterday > >about "rm -fr /" protection, which I liked a lot: > >http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > > > >His idea was remarkably simple, so I went ahead and wrote this patch for > >rm(1) of FreeBSD: > > > > This does only help for the obvious case of '/' but not for the > './' and '../' or '../../' ... accidents. > > Furthermore does it prevent root from doing `rm -rf /` which is a pretty > legal operation for root since he knows what he is doing. > > This is UNIX, not Windows. Do you also want to be able to swap to the root partition while it's mounted? We can bring back that feature, too. But personally, I don't see anything wrong with the view that operations that are guaranteed to shoot people in the foot should be disallowed. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 19:02: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 70EA216A4CE; Sat, 2 Oct 2004 19:02:14 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 25A6743D39; Sat, 2 Oct 2004 19:02:14 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i92J2THQ001251; Sat, 2 Oct 2004 15:02:29 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i92J2TJN001250; Sat, 2 Oct 2004 15:02:29 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 2 Oct 2004 15:02:29 -0400 From: David Schultz To: "Jacques A. Vidrine" , Peter Jeremy , Giorgos Keramidas , freebsd-hackers@FreeBSD.ORG Message-ID: <20041002190229.GB1029@VARK.MIT.EDU> Mail-Followup-To: "Jacques A. Vidrine" , Peter Jeremy , Giorgos Keramidas , freebsd-hackers@freebsd.org References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <20041002124349.GA21569@cirb503493.alcatel.com.au> <20041002164607.GD90985@madman.celabo.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002164607.GD90985@madman.celabo.org> Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 19:02:14 -0000 On Sat, Oct 02, 2004, Jacques A. Vidrine wrote: > FWIW, I'm not in favor of adding ad-hoc "features" to handle edge-cases. > ("feature" because this is actually introducing a bug :-) > > I picked this email to which to respond, because I can share my own > stupidity. Case much like the one described above, but my cronjob > included something like: > > cd /path/to/directory/with/temporary/files > rm -fr * > > Only another admin removed > `/path/to/directory/with/temporary/files'... so the `cd' failed > and left the current directory as `/'. For some reason the system > crashed :-) ... and then crashed again a few days after restoring > from backup... doh! > > > Will the next step be to prevent `rm -fr *' iff the current working > directory is '/' ? Please explain your answer. :-) Hmm...good point. Since we can never hope to cover *all* the ways for people to shoot themselves in the foot, let's just take off the existing seatbelts. If people try to load old kernel modules, the system will just crash. If they try to mount a device twice, it'll corrupt the filesystem. And of course there's no need to validate buffers passed to the kernel from root, much less even check their length. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 19:06: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 8961216A4CE for ; Sat, 2 Oct 2004 19:06:01 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2295443D55 for ; Sat, 2 Oct 2004 19:06:01 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i92J8kKt088491; Sat, 2 Oct 2004 13:08:46 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i92J8kxj088488; Sat, 2 Oct 2004 13:08:46 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 2 Oct 2004 13:08:46 -0600 (MDT) From: Doug Russell To: Sean Farley In-Reply-To: <20041002095910.Y4180@thor.farley.org> Message-ID: <20041002125851.J88183-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Jim Durham Subject: Re: Sudden Reboots 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, 02 Oct 2004 19:06:01 -0000 On Sat, 2 Oct 2004, Sean Farley wrote: > I had sudden reboots over a period of two years. Recently, they started > happening more often. It turned out that the capacitors had gone bad. > > Capacitors from about two to three years ago used a poor formula. This > site has information about it: http://www.badcaps.net/. Even the best quality new ones can wear out and cause these problems with only the smallest of defects inside eventually making them unusable for the type of circuitry they're used in. (The current pulse demands on these caps in switching regulators are absolutely rediculous). I've got a whole little plastic bin full of them to replace ones on bad boards. When you order them, look very closely at the specifications, especially at how much current they're rated to handle for a given value, and get the ones with the highet current rating, even if you have to go with a higher voltage (I often use 10v caps to replace 6.3v ones when they'll fit, as the particular brands I've been using have significantly higher current capability for the same uF value), and perhaps go with a slightly higher uF value (really helps to understand the circuit, though. Don't go TOO much higher than the original value). > The interesting thing for me was that the capacitors did not show any > signs for about two years. They looked like they had flat tops without Sure... and these types of problems often show up only after being powered off for some time, etc. The OP said two of his boxes mysteriously "fixed" themselves. Just because they haven't failed for some time doesn't mean there isn't still something flakey in there. His problems REALLY sound to me like capacitor problems in the PSU or, more likely, the voltage regulators on the motherboard. Seen this type of problem many, many times. Having an ESR tester is handy, also..... Later...... From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 19:16: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 C4D4116A4CE; Sat, 2 Oct 2004 19:16:28 +0000 (GMT) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2D0D143D46; Sat, 2 Oct 2004 19:16:28 +0000 (GMT) (envelope-from mike@reifenberger.com) Received: from fwd00.aul.t-online.de by mailout03.sul.t-online.com with smtp id 1CDpMo-0006YT-01; Sat, 02 Oct 2004 21:16:26 +0200 Received: from fw.reifenberger.com (VanWn2ZXreWGAqh93sntsdJIVHCZ9Vryu7MzXiy8Vux-AFsp9tWJZR@[217.232.221.224]) by fmrl00.sul.t-online.com with esmtp id 1CDpMc-1aASW00; Sat, 2 Oct 2004 21:16:14 +0200 Received: from localhost (mike@localhost)i92JG970024488; Sat, 2 Oct 2004 21:16:09 +0200 (CEST) (envelope-from mike@reifenberger.com) X-Authentication-Warning: fw.reifenberger.com: mike owned process doing -bs Date: Sat, 2 Oct 2004 21:16:08 +0200 (CEST) From: Michael Reifenberger To: Giorgos Keramidas In-Reply-To: <20041002175517.GA2230@gothmog.gr> Message-ID: <20041002204851.K24332@fw.reifenberger.com> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002165155.GP35869@seekingfire.com> <20041002175517.GA2230@gothmog.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ID: VanWn2ZXreWGAqh93sntsdJIVHCZ9Vryu7MzXiy8Vux-AFsp9tWJZR@t-dialin.net X-TOI-MSGID: 1c54a4e3-de46-4d35-a095-a9cf612db829 cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 19:16:28 -0000 On Sat, 2 Oct 2004, Giorgos Keramidas wrote: ... >> Exactly. Who would expect `rm -rf /` to actually succeed? It's not only >> dangerous, it doesn't work in a useful way ;-) >> >> If one is thinking about `rm -rf /`, `newfs` is probably the right >> answer. > ... newfs only works if the root is not mounted because otherwise the device is locked. (Hmm is GEOM too anti foot shooting? But can't you reenable foot-shooting via sysctl?) whereas `rm -rf /` works allwsys :-) Anyway. Check your karma. I've managed to remove large parts of my (and other) various systems several times. Every time this happend I where not concentrated or felt in dangerous safety. Once you realize that there is no seatbelt, you make less errors and have better backups. But many thanks to try to make FreeBSD and its operators better! Bye/2 --- Michael Reifenberger, Business Development Manager SAP-Basis, Plaut Consulting Comp: Michael.Reifenberger@plaut.de | Priv: Michael@Reifenberger.com http://www.plaut.de | http://www.Reifenberger.com From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 19:18: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 735AE16A4CE for ; Sat, 2 Oct 2004 19:18:33 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CCB543D39 for ; Sat, 2 Oct 2004 19:18:33 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i92JLLKt088571 for ; Sat, 2 Oct 2004 13:21:21 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i92JLLbm088568 for ; Sat, 2 Oct 2004 13:21:21 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 2 Oct 2004 13:21:21 -0600 (MDT) From: Doug Russell To: freebsd-hackers@freebsd.org In-Reply-To: <1221615358.20041002164846@andric.com> Message-ID: <20041002131621.T88183-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 19:18:33 -0000 On Sat, 2 Oct 2004, Dimitry Andric wrote: > Of course, your work is commendable, but isn't is much simpler to just > not type commands like that? I mean, "rm -rf /etc" or "rm -rf /bin" > are just as bad, but do you really want to be checking for all > possible `bad' deletions? That way, we'll start to look like some > software from Redmond... :) There are many times where sanity checking is an absolute must, but I think it should be implemented in the shell, or a safety later of some kind in those instances where it is necessary, not in the actual workings of the system itself, IMHO. Later...... From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 19:26: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 77A3616A4CE; Sat, 2 Oct 2004 19:26:26 +0000 (GMT) Received: from mailout10.sul.t-online.com (mailout10.sul.t-online.com [194.25.134.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DC8243D1F; Sat, 2 Oct 2004 19:26:26 +0000 (GMT) (envelope-from mike@reifenberger.com) Received: from fwd07.aul.t-online.de by mailout10.sul.t-online.com with smtp id 1CDpWS-0004qn-01; Sat, 02 Oct 2004 21:26:24 +0200 Received: from fw.reifenberger.com (X7jICiZTQejXrAzlrjlLj3tA0nOUllxt2AhcHBmCeL9+UI23uemn66@[217.232.221.224]) by fmrl07.sul.t-online.com with esmtp id 1CDpWQ-1Fuc9g0; Sat, 2 Oct 2004 21:26:22 +0200 Received: from localhost (mike@localhost)i92JQMeH024525; Sat, 2 Oct 2004 21:26:22 +0200 (CEST) (envelope-from mike@reifenberger.com) X-Authentication-Warning: fw.reifenberger.com: mike owned process doing -bs Date: Sat, 2 Oct 2004 21:26:21 +0200 (CEST) From: Michael Reifenberger To: David Schultz In-Reply-To: <20041002185055.GA1029@VARK.MIT.EDU> Message-ID: <20041002211759.R24332@fw.reifenberger.com> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002185055.GA1029@VARK.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ID: X7jICiZTQejXrAzlrjlLj3tA0nOUllxt2AhcHBmCeL9+UI23uemn66@t-dialin.net X-TOI-MSGID: 27442d0e-9b19-4f4d-8f1a-0a6210375166 cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 19:26:26 -0000 On Sat, 2 Oct 2004, David Schultz wrote: ... > Do you also want to be able to swap to the root partition while > it's mounted? We can bring back that feature, too. But > personally, I don't see anything wrong with the view that > operations that are guaranteed to shoot people in the foot should > be disallowed. > Every anti foot shooting takes time to check for. A strncmp for every arg is maybe ok. Traversing the tree for realpath is not. The job for `rm` is to remove whatever it is given to get removed. As fast as possible. Nothing else. Bye/2 --- Michael Reifenberger, Business Development Manager SAP-Basis, Plaut Consulting Comp: Michael.Reifenberger@plaut.de | Priv: Michael@Reifenberger.com http://www.plaut.de | http://www.Reifenberger.com From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 19:37: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 6FFA716A4CE; Sat, 2 Oct 2004 19:37:55 +0000 (GMT) Received: from nerve.riss-telecom.ru (nerve.riss-telecom.ru [80.66.65.3]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78A7143D41; Sat, 2 Oct 2004 19:37:54 +0000 (GMT) (envelope-from frol@nerve.riss-telecom.ru) Received: from nerve.riss-telecom.ru (localhost [127.0.0.1]) i92JboVQ019982; Sun, 3 Oct 2004 02:37:50 +0700 (NOVST) (envelope-from frol@nerve.riss-telecom.ru) Received: (from frol@localhost) by nerve.riss-telecom.ru (8.12.10/8.12.10/Submit) id i92Jboaq019981; Sun, 3 Oct 2004 02:37:50 +0700 (NOVST) (envelope-from frol) Date: Sun, 3 Oct 2004 02:37:50 +0700 From: Dmitry Frolov To: Giorgos Keramidas Message-ID: <20041002193750.GA19271@nerve.riss-telecom.ru> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002085143.GA52519@gothmog.gr> <20041002090635.GA71050@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002090635.GA71050@gothmog.gr> Organization: RISS-Telecom, JSC X-PGP-Fingerprint: 5232 98E7 596E 21C2 52B5 FCAE 8088 3F87 88BC 27B0 User-Agent: Mutt/1.5.1i cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 19:37:55 -0000 * Giorgos Keramidas [02.10.2004 16:07]: > On 2004-10-02 11:51, Giorgos Keramidas wrote: > > On 2004-10-02 10:34, Michael Reifenberger wrote: > > > > > > This does only help for the obvious case of '/' but not for the > > > './' and '../' or '../../' ... accidents. > > > > Hmm, indeed. This can be fixed, but it might take a little thinking > > over about ways to implement it without adding too much overhead to the > > way rm(1) works now. > > One way to do that is to use realpath(3), but I have to ask more > knowledgeable people about the comment immediately below my change: Other way that may be cheaper is to stat '/', stat each argument and then compare device and inode numbers. wbr&w, dmitry. -- Dmitry Frolov RISS-Telecom Network, Novosibirsk, Russia 66415911@ICQ, +7 3832 NO WA1T, DVF-RIPE From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 19:48: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 9F8E116A4CE; Sat, 2 Oct 2004 19:48:23 +0000 (GMT) Received: from mxb.saturn-tech.com (mxb.saturn-tech.com [207.229.19.99]) by mx1.FreeBSD.org (Postfix) with ESMTP id 57AB443D39; Sat, 2 Oct 2004 19:48:23 +0000 (GMT) (envelope-from drussell@saturn-tech.com) Received: from mxb.saturn-tech.com (localhost [127.0.0.1]) by mxb.saturn-tech.com (8.12.3/8.12.3) with ESMTP id i92JpBKt088714; Sat, 2 Oct 2004 13:51:11 -0600 (MDT) (envelope-from drussell@saturn-tech.com) Received: from localhost (drussell@localhost)i92JpBw1088711; Sat, 2 Oct 2004 13:51:11 -0600 (MDT) (envelope-from drussell@saturn-tech.com) X-Authentication-Warning: mxb.saturn-tech.com: drussell owned process doing -bs Date: Sat, 2 Oct 2004 13:51:11 -0600 (MDT) From: Doug Russell To: Giorgos Keramidas In-Reply-To: <20041002171052.GA2000@gothmog.gr> Message-ID: <20041002135000.N88183-100000@mxb.saturn-tech.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 19:48:23 -0000 On Sat, 2 Oct 2004, Giorgos Keramidas wrote: > I see a lot of people don't like the change, even though I made it > default to off and controlled by an environment variable. There's > no reason to keep pushing for it, then. There's significant support for it, too. As long as it can be disabled, I don't mind it at all. Later...... From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 20:11:56 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 6D5DE16A4CE for ; Sat, 2 Oct 2004 20:11:56 +0000 (GMT) Received: from VARK.MIT.EDU (VARK.MIT.EDU [18.95.3.179]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20E2E43D1F for ; Sat, 2 Oct 2004 20:11:56 +0000 (GMT) (envelope-from das@FreeBSD.ORG) Received: from VARK.MIT.EDU (localhost [127.0.0.1]) by VARK.MIT.EDU (8.13.1/8.12.10) with ESMTP id i92KCBQ4001743; Sat, 2 Oct 2004 16:12:11 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by VARK.MIT.EDU (8.13.1/8.12.10/Submit) id i92KCBcv001742; Sat, 2 Oct 2004 16:12:11 -0400 (EDT) (envelope-from das@FreeBSD.ORG) Date: Sat, 2 Oct 2004 16:12:11 -0400 From: David Schultz To: Michael Reifenberger Message-ID: <20041002201211.GA1677@VARK.MIT.EDU> Mail-Followup-To: Michael Reifenberger , freebsd-hackers@FreeBSD.ORG References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002185055.GA1029@VARK.MIT.EDU> <20041002211759.R24332@fw.reifenberger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002211759.R24332@fw.reifenberger.com> cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 20:11:56 -0000 On Sat, Oct 02, 2004, Michael Reifenberger wrote: > On Sat, 2 Oct 2004, David Schultz wrote: > ... > >Do you also want to be able to swap to the root partition while > >it's mounted? We can bring back that feature, too. But > >personally, I don't see anything wrong with the view that > >operations that are guaranteed to shoot people in the foot should > >be disallowed. > > > > Every anti foot shooting takes time to check for. > A strncmp for every arg is maybe ok. Traversing the tree for realpath is > not. > The job for `rm` is to remove whatever it is given to get removed. > As fast as possible. Nothing else. Sigh. The original patch that just used strcmp() wouldn't have increased the time to execute rm by more than a few hundred nanoseconds. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 20:49: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 7E8A216A4CE; Sat, 2 Oct 2004 20:49:54 +0000 (GMT) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0DB4A43D2D; Sat, 2 Oct 2004 20:49:54 +0000 (GMT) (envelope-from mike@reifenberger.com) Received: from fwd10.aul.t-online.de by mailout11.sul.t-online.com with smtp id 1CDqpE-0000v7-00; Sat, 02 Oct 2004 22:49:52 +0200 Received: from fw.reifenberger.com (XdwUWEZToeg-ms2QQQLq9GYikBc1MlWY+vD-G2+qy3rCX1mF-xIeY6@[217.232.221.224]) by fmrl10.sul.t-online.com with esmtp id 1CDqp0-0K0AZU0; Sat, 2 Oct 2004 22:49:38 +0200 Received: from localhost (mike@localhost)i92KnbBk024804; Sat, 2 Oct 2004 22:49:37 +0200 (CEST) (envelope-from mike@reifenberger.com) X-Authentication-Warning: fw.reifenberger.com: mike owned process doing -bs Date: Sat, 2 Oct 2004 22:49:37 +0200 (CEST) From: Michael Reifenberger To: David Schultz In-Reply-To: <20041002201211.GA1677@VARK.MIT.EDU> Message-ID: <20041002224230.T24332@fw.reifenberger.com> References: <20041002081928.GA21439@gothmog.gr> <20041002102918.W22102@fw.reifenberger.com> <20041002211759.R24332@fw.reifenberger.com> <20041002201211.GA1677@VARK.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ID: XdwUWEZToeg-ms2QQQLq9GYikBc1MlWY+vD-G2+qy3rCX1mF-xIeY6@t-dialin.net X-TOI-MSGID: 993cfe92-ea30-4cce-833c-6d8c5d887c10 cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 20:49:54 -0000 On Sat, 2 Oct 2004, David Schultz wrote: > Date: Sat, 2 Oct 2004 16:12:11 -0400 > From: David Schultz > To: Michael Reifenberger > Cc: freebsd-hackers@FreeBSD.ORG > Subject: Re: Protection from the dreaded "rm -fr /" > > On Sat, Oct 02, 2004, Michael Reifenberger wrote: >> On Sat, 2 Oct 2004, David Schultz wrote: >> ... >>> Do you also want to be able to swap to the root partition while >>> it's mounted? We can bring back that feature, too. But >>> personally, I don't see anything wrong with the view that >>> operations that are guaranteed to shoot people in the foot should >>> be disallowed. >>> >> >> Every anti foot shooting takes time to check for. >> A strncmp for every arg is maybe ok. Traversing the tree for realpath is >> not. >> The job for `rm` is to remove whatever it is given to get removed. >> As fast as possible. Nothing else. > > Sigh. The original patch that just used strcmp() wouldn't have > increased the time to execute rm by more than a few hundred > nanoseconds. > Wasn't there a discussion recently to increase ARG_MAX...? :-) Bye/2 --- Michael Reifenberger, Business Development Manager SAP-Basis, Plaut Consulting Comp: Michael.Reifenberger@plaut.de | Priv: Michael@Reifenberger.com http://www.plaut.de | http://www.Reifenberger.com From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 21:05: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 89C7B16A4CE for ; Sat, 2 Oct 2004 21:05:55 +0000 (GMT) Received: from mail.seekingfire.com (coyote.seekingfire.com [24.72.10.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51F5F43D54 for ; Sat, 2 Oct 2004 21:05:55 +0000 (GMT) (envelope-from tillman@seekingfire.com) Received: by mail.seekingfire.com (Postfix, from userid 500) id B87C52D6; Sat, 2 Oct 2004 15:05:54 -0600 (CST) Date: Sat, 2 Oct 2004 15:05:54 -0600 From: Tillman Hodgson To: freebsd-hackers@freebsd.org Message-ID: <20041002210554.GS35869@seekingfire.com> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002165155.GP35869@seekingfire.com> <20041002175517.GA2230@gothmog.gr> <20041002204851.K24332@fw.reifenberger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002204851.K24332@fw.reifenberger.com> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . X-GPG-Key-ID: 828AFC7B X-GPG-Fingerprint: 5584 14BA C9EB 1524 0E68 F543 0F0A 7FBC 828A FC7B X-GPG-Key: http://www.seekingfire.com/gpg_key.asc X-Urban-Legend: There is lots of hidden information in headers User-Agent: Mutt/1.5.6i Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 21:05:55 -0000 On Sat, Oct 02, 2004 at 09:16:08PM +0200, Michael Reifenberger wrote: > On Sat, 2 Oct 2004, Giorgos Keramidas wrote: > ... > >>Exactly. Who would expect `rm -rf /` to actually succeed? It's not only > >>dangerous, it doesn't work in a useful way ;-) > >> > >>If one is thinking about `rm -rf /`, `newfs` is probably the right > >>answer. > > newfs only works if the root is not mounted because otherwise the device is > locked. (Hmm is GEOM too anti foot shooting? But can't you reenable > foot-shooting via sysctl?) whereas `rm -rf /` works allwsys > :-) It'll never work, though, that's the thing. At some point it'll rm something it itself needs and error out. There isn't a way to use `rm -rf /` that /doesn't/ result in foot-shooting. This isn't a sub-tree like /etc or /sbin (which are rooted in /), this is only to treat / itself specially. -T -- "If knowledge creates problems, ignorance will not solve them" -- Isaac Asimov. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 21:22: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 3F9DA16A4CE; Sat, 2 Oct 2004 21:22:55 +0000 (GMT) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94F8F43D49; Sat, 2 Oct 2004 21:22:54 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.13.0/8.13.0) with ESMTP id i92LMpfk009461; Sat, 2 Oct 2004 17:22:53 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <20041002175704.GB2230@gothmog.gr> References: <20041002175704.GB2230@gothmog.gr> Date: Sat, 2 Oct 2004 17:22:50 -0400 To: Giorgos Keramidas , Lee Harr From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 21:22:55 -0000 At 8:57 PM +0300 10/2/04, Giorgos Keramidas wrote: >On 2004-10-02 21:23, Lee Harr wrote: > > > John Beck, who works for Sun, has posted an entry in his blog > > > yesterday about "rm -fr /" protection, which I liked a lot: > > > > > > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection >> > > > > His idea was remarkably simple, so I went ahead and wrote this > > > patch for rm(1) of FreeBSD: > > >> How about: >> >> chflags sunlnk / >> ? > >Setting sunlink on / will only protect the / directory, not its >descendants, so you don't gain much. We could add a new flag "srunlnk", or maybe even "srm-r". The "rm" command will always have to stat() the file it is given (just to see if it is a directory), so it could check to see if this flag is turned on. If it is turned on, then 'rm' could refuse to honor any '-rf' request on that directory. I like the idea of *some* kind of protection for "rm -rf /", but I think it would be better as something more generally useful than protecting against that one single case. While I have typed in a few dozen disastrous "rm -rf" commands, I have never actually typed in "rm -rf /", so this particular seat belt would never have done me any good. By tieing the feature to a settable flag, then I would have the option to protect to other directories (if I wanted to add such protection). -- 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 Sat Oct 2 22:00: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 C300016A50E; Sat, 2 Oct 2004 22:00:40 +0000 (GMT) Received: from shrike.submonkey.net (cpc2-cdif3-6-0-cust204.cdif.cable.ntl.com [81.103.67.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 791C143D1D; Sat, 2 Oct 2004 22:00:37 +0000 (GMT) (envelope-from setantae@submonkey.net) Received: from setantae by shrike.submonkey.net with local (Exim 4.42 (FreeBSD)) id 1CDrvg-000K0g-0H; Sat, 02 Oct 2004 23:00:36 +0100 Date: Sat, 2 Oct 2004 23:00:35 +0100 From: Ceri Davies To: Garance A Drosihn Message-ID: <20041002220035.GD2493@submonkey.net> Mail-Followup-To: Ceri Davies , Garance A Drosihn , Giorgos Keramidas , Lee Harr , freebsd-hackers@freebsd.org References: <20041002175704.GB2230@gothmog.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OMnfC9oq5hdMsh0V" Content-Disposition: inline In-Reply-To: X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.6i Sender: Ceri Davies cc: freebsd-hackers@freebsd.org cc: Lee Harr cc: Giorgos Keramidas Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 22:00:40 -0000 --OMnfC9oq5hdMsh0V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 02, 2004 at 05:22:50PM -0400, Garance A Drosihn wrote: > At 8:57 PM +0300 10/2/04, Giorgos Keramidas wrote: > >On 2004-10-02 21:23, Lee Harr wrote: > > > > John Beck, who works for Sun, has posted an entry in his blog > > > > yesterday about "rm -fr /" protection, which I liked a lot: > > > > > > > > http://blogs.sun.com/roller/page/jbeck/20041001#rm_rf_protection > >> > > > > > His idea was remarkably simple, so I went ahead and wrote this > > > > patch for rm(1) of FreeBSD: > > > > >> How about: > >> > >> chflags sunlnk / > >> ? > > > >Setting sunlink on / will only protect the / directory, not its > >descendants, so you don't gain much. >=20 > We could add a new flag "srunlnk", or maybe even "srm-r". The "rm" > command will always have to stat() the file it is given (just to > see if it is a directory), so it could check to see if this flag > is turned on. If it is turned on, then 'rm' could refuse to honor > any '-rf' request on that directory. I love the idea of this; it's the most elegant solution offered yet. I'm also looking forward to the forthcoming bikeshed regarding exactly what the flag should be called. ;-) Ceri --=20 It is not tinfoil, it is my new skin. I am a robot. --OMnfC9oq5hdMsh0V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBXyUDocfcwTS3JF8RAnBtAJ9DurokB5+yyohTOh2Wf+E/2qTUbwCcD1le sHabZE2tUKfIiPaIhHolZAU= =/IFq -----END PGP SIGNATURE----- --OMnfC9oq5hdMsh0V-- From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 22:11: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 80B5816A4CE for ; Sat, 2 Oct 2004 22:11:19 +0000 (GMT) Received: from cydem.org (S0106000103ce4c9c.ed.shawcable.net [68.149.254.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3BC5B43D4C for ; Sat, 2 Oct 2004 22:11:19 +0000 (GMT) (envelope-from soralx@cydem.org) Received: from S01060020ed3972ba.ed.shawcable.net (S01060020ed3972ba.ed.shawcable.net [68.149.254.42]) by cydem.org (Postfix/FreeBSD) with ESMTP id C20B538DB1; Sat, 2 Oct 2004 16:11:18 -0600 (MDT) From: To: Ceri Davies , Garance A Drosihn Date: Sat, 2 Oct 2004 16:11:13 -0600 User-Agent: KMail/1.5.4 References: <20041002220035.GD2493@submonkey.net> In-Reply-To: <20041002220035.GD2493@submonkey.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200410021611.13450.soralx@cydem.org> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 22:11:19 -0000 > > We could add a new flag "srunlnk", or maybe even "srm-r". The "rm" > > command will always have to stat() the file it is given (just to > > see if it is a directory), so it could check to see if this flag > > is turned on. If it is turned on, then 'rm' could refuse to honor > > any '-rf' request on that directory. Why not to just add a flag to 'rm'? For example, `rm -rf /` or `cd; rm -rf .././` will fail, but `rm -rF /` will succeed. Timestamp: 0x415F2702 [SorAlx] http://cydem.org.ua/ ridin' VN1500-B2 From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 22:42: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 A004616A4CF for ; Sat, 2 Oct 2004 22:42:00 +0000 (GMT) Received: from smarthost2.sentex.ca (smarthost2.sentex.ca [205.211.164.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D37343D41 for ; Sat, 2 Oct 2004 22:42:00 +0000 (GMT) (envelope-from mike@sentex.net) Received: from BLUELAPIS.sentex.ca (cage.simianscience.com [64.7.134.1]) by smarthost2.sentex.ca (8.13.1/8.13.1) with SMTP id i92Mfwrw056135; Sat, 2 Oct 2004 18:41:58 -0400 (EDT) (envelope-from mike@sentex.net) From: Mike Tancsa To: David Scheidt Date: Sat, 02 Oct 2004 18:42:02 -0400 Message-ID: References: <200409301003.00492.durham@jcdurham.com> <20041001223802.GA90717@xor.obsecurity.org> <200410012023.04922.durham@jcdurham.com> In-Reply-To: X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable cc: freebsd-hackers@freebsd.org Subject: Re: Sudden Reboots 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, 02 Oct 2004 22:42:00 -0000 On Fri, 1 Oct 2004 21:50:26 -0500, in sentex.lists.freebsd.hackers you wrote: > >On Oct 1, 2004, at 7:23 PM, Jim Durham wrote: >> These are very rare.... except they seem to happen about once a day=20 >> for a >> while and then stop... very strange.. >> >>> and usually caused by hardware problems (e.g. faulty power supply, >>> overheating CPU, bad RAM). >> >> Possible, but if so, the hardware fixed itself on the first two boxes = I >> mentioned. > >All of this can be bad, or not quite bad -- just not healthy --=20 >hardware. Say a power supply that can't supply reliable +5, when the=20 >line voltage drops a tad while all the disks are being hammered. It=20 >can be a nightmare to figure out. Setup crash dumps, but also make=20 >sure that the UPS the box is attached to isn't having problems. If=20 >it's not on conditioned power, fix that. Also, a lot of older UPSes do not have any AVR (automatic voltage regulation). This in conjunction with a marginal power supply can cause problems like you describe. One of our POPs are in an area that has seen tremendous residential and industrial growth putting a strain on the local power. Prior to some major upgrades from the local utility company, we would see street power dropping below 100V during peak usage coming from the street and our APCs that have "smart boost" would all kick in to compensate. Also, the UPS can just be "bad" over time. As others have said, its pretty rare that reboots do not leave a crash dump behind when its a software issue. At the very least, enable crash dumps on your machines in question. See the man page for dumpon. At least this way you can narrow down the odds as to whether or not its pointing to a hardware or software issue. ---Mike From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 23:28: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 ED15016A4CE for ; Sat, 2 Oct 2004 23:28:46 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2A4BC43D31 for ; Sat, 2 Oct 2004 23:28:46 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b221.otenet.gr [212.205.244.229]) i92NShmc005775; Sun, 3 Oct 2004 02:28:44 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i92NSe8P001816; Sun, 3 Oct 2004 02:28:40 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i92NFkoI001703; Sun, 3 Oct 2004 02:15:46 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sun, 3 Oct 2004 02:15:46 +0300 From: Giorgos Keramidas To: Michael Reifenberger Message-ID: <20041002231546.GD1381@gothmog.gr> References: <20041002081928.GA21439@gothmog.gr> <200410021123.59811.max@love2party.net> <20041002102430.Y5481@thor.farley.org> <20041002165155.GP35869@seekingfire.com> <20041002175517.GA2230@gothmog.gr> <20041002204851.K24332@fw.reifenberger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041002204851.K24332@fw.reifenberger.com> cc: freebsd-hackers@freebsd.org Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 23:28:47 -0000 On 2004-10-02 21:16, Michael Reifenberger wrote: >> Exactly. Who would expect `rm -rf /` to actually succeed? It's not >> only dangerous, it doesn't work in a useful way ;-) >> >> If one is thinking about `rm -rf /`, `newfs` is probably the right >> answer. > > newfs only works if the root is not mounted because otherwise the > device is locked. No it doesn't. You're just protected by GEOM's locking of the partition table for mounted partitions. > (Hmm is GEOM too anti foot shooting? Yes. > But can't you reenable foot-shooting via sysctl?) Not via a sysctl, but there is an ioctl to do that now: DIOCSMBR. See revision 1.14 of src/usr.sbin/boot0cfg/boot0cfg.c for an example. From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 2 23:28: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 2466616A4CE for ; Sat, 2 Oct 2004 23:28:49 +0000 (GMT) Received: from kane.otenet.gr (kane.otenet.gr [195.170.0.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 35F5143D31 for ; Sat, 2 Oct 2004 23:28:48 +0000 (GMT) (envelope-from keramida@freebsd.org) Received: from gothmog.gr (patr530-b221.otenet.gr [212.205.244.229]) i92NSjcD005779; Sun, 3 Oct 2004 02:28:46 +0300 Received: from gothmog.gr (gothmog [127.0.0.1]) by gothmog.gr (8.13.1/8.13.1) with ESMTP id i92NSe8T001816; Sun, 3 Oct 2004 02:28:43 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from giorgos@localhost) by gothmog.gr (8.13.1/8.13.1/Submit) id i92N2Q0i001515; Sun, 3 Oct 2004 02:02:26 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sun, 3 Oct 2004 02:02:26 +0300 From: Giorgos Keramidas To: Garance A Drosihn Message-ID: <20041002230226.GC1381@gothmog.gr> References: <20041002175704.GB2230@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: cc: freebsd-hackers@freebsd.org cc: Lee Harr Subject: Re: Protection from the dreaded "rm -fr /" 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, 02 Oct 2004 23:28:49 -0000 On 2004-10-02 17:22, Garance A Drosihn wrote: > At 8:57 PM +0300 10/2/04, Giorgos Keramidas wrote: > >On 2004-10-02 21:23, Lee Harr wrote: > >> How about: > >> chflags sunlnk / > >> ? > > > >Setting sunlink on / will only protect the / directory, not its > >descendants, so you don't gain much. > > We could add a new flag "srunlnk", or maybe even "srm-r". The "rm" > command will always have to stat() the file it is given (just to > see if it is a directory), so it could check to see if this flag > is turned on. If it is turned on, then 'rm' could refuse to honor > any '-rf' request on that directory. [...] Hmmm. This sounds much better indeed :-)