From owner-freebsd-questions@FreeBSD.ORG Mon Apr 25 15:46:34 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BAAA106566C for ; Mon, 25 Apr 2011 15:46:34 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 322308FC1C for ; Mon, 25 Apr 2011 15:46:33 +0000 (UTC) Received: by vxc34 with SMTP id 34so2566270vxc.13 for ; Mon, 25 Apr 2011 08:46:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.92.45 with SMTP id cj13mr6441439vdb.105.1303746393380; Mon, 25 Apr 2011 08:46:33 -0700 (PDT) Received: by 10.52.163.39 with HTTP; Mon, 25 Apr 2011 08:46:33 -0700 (PDT) X-Originating-IP: [93.221.187.36] In-Reply-To: <20110425151536.GA61425@stainmore> References: <20110425151846.0a5359fd@gumby.homeunix.com> <20110425151536.GA61425@stainmore> Date: Mon, 25 Apr 2011 17:46:33 +0200 Message-ID: From: "C. P. Ghost" To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: Password theft from memory? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 15:46:34 -0000 On Mon, Apr 25, 2011 at 5:15 PM, Bob Hall wrote: > On Mon, Apr 25, 2011 at 03:18:46PM +0100, RW wrote: >> I don't believe the heap is allocated zeroed pages. =A0The kernel >> does allocate such pages to the BSS segment, but that's because it >> holds zeroed data such as C static variables. > > According to McKusick and Neville-Neil's book on FreeBSD, sbrk extends > the uninitialized data segment with zero-filled pages. Since malloc() is > an interface to sbrk, it does the same thing. True, except that malloc(3) now uses both sbrk(2) and mmap(2) allocators, depending on the user-settable flags in /etc/malloc.conf, MALLOC_OPTIONS and the global variable _malloc_options. So you have to look into mmap(2) too. -cpghost. --=20 Cordula's Web. http://www.cordula.ws/