From owner-freebsd-current@FreeBSD.ORG Mon Feb 9 15:19:00 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CDB516A4CE for ; Mon, 9 Feb 2004 15:19:00 -0800 (PST) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5E1C43D1F for ; Mon, 9 Feb 2004 15:18:59 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])i19NIpLE016321; Tue, 10 Feb 2004 10:18:51 +1100 Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) i19NIjYc016273; Tue, 10 Feb 2004 10:18:49 +1100 Date: Tue, 10 Feb 2004 10:18:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Stefan Farfeleder In-Reply-To: <20040209145920.GA623@wombat.fafoe.narf.at> Message-ID: <20040210101500.N50462@gamplex.bde.org> References: <20040209023623.GA30071@xor.obsecurity.org> <20040209145920.GA623@wombat.fafoe.narf.at> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: current@freebsd.org cc: Kris Kennaway Subject: Re: grep bug X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Feb 2004 23:19:00 -0000 On Mon, 9 Feb 2004, Stefan Farfeleder wrote: > On Sun, Feb 08, 2004 at 06:36:23PM -0800, Kris Kennaway wrote: > > kkenn@rot13:~ grep -r foo / > /dev/null > > grep: /dev/network: Permission denied > > grep: /dev/geom.ctl: Permission denied > > grep: /dev/devctl: Permission denied > > grep: /dev/ata: Permission denied > > grep: /dev/console: Permission denied > > grep in realloc(): error: allocation failed > > ^C^C^CAbort (core dumped) > > -current aborts by default on memory allocation failures, you have to > set the 'a' flag via MALLOC_OPTIONS or /etc/malloc.conf. I have this turned off in /etc/malloc.conf, but turning it off has been broken for about a year for user root and group wheel: %%% Index: malloc.c =================================================================== RCS file: /home/ncvs/src/lib/libc/stdlib/malloc.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -2 -r1.72 -r1.73 --- malloc.c 21 Aug 2002 17:11:00 -0000 1.72 +++ malloc.c 23 Jan 2003 21:26:47 -0000 1.73 @@ -10,5 +10,5 @@ #include -__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.72 2002/08/21 17:11:00 phk Exp $"); +__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.73 2003/01/23 21:26:47 phk Exp $"); /* @@ -465,4 +465,11 @@ } } + + /* + * Sensitive processes, somewhat arbitrarily defined here as setuid, + * setgid, root and wheel cannot afford to have malloc mistakes. + */ + if (issetugid() || getuid() == 0 || getgid() == 0) + malloc_abort = 1; UTRACE(0, 0, 0); %%% This code is executed after parsing MALLOC_OPTIONS etc., so there is no way to override it. Bruce