From owner-freebsd-questions@FreeBSD.ORG Mon Apr 25 17:54:25 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 DD27F1065673 for ; Mon, 25 Apr 2011 17:54:25 +0000 (UTC) (envelope-from rjhjr0@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3838FC1A for ; Mon, 25 Apr 2011 17:54:25 +0000 (UTC) Received: by gyg13 with SMTP id 13so934749gyg.13 for ; Mon, 25 Apr 2011 10:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=jO/6g9ZK5/wDi1avaGw/7SuyiMEYrRMS4so+J1Fd0YQ=; b=c7qSCPX++JFwkQ3sJf4rT1qmDNmz5ZsfKV+OfxtbWJu7nLpUi4XO4rsb/+9aKLMesi zj8L4D0YiYCzJzCcbgKfHWDCK//Egs3i7mCpopaICZS9JYici7EPcsiUStPQFvKWDFFv 8bjlaQ4cMHVyK7vV6HXE8iM9BGDvKHrnTI22g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; b=PqySZuPRRB+f3ST8fUxeNxRA0BSCrMaGz/jnJcbRD4siUWpkAxd9cnDXDVCCX6TGr1 MMwFe/uGKvXDAYfqrj8T8dS1BO6TjF+Nz42pNm+bEgkDAmdFYSbztAIfAus88WJ/rx3F d1Wm8x7cta5UGIxA5EoFl9SfkIYiF3t2uXkw4= Received: by 10.236.78.168 with SMTP id g28mr4350890yhe.211.1303754064764; Mon, 25 Apr 2011 10:54:24 -0700 (PDT) Received: from localhost (ip98-163-115-74.dc.dc.cox.net [98.163.115.74]) by mx.google.com with ESMTPS id x64sm2318942yhn.39.2011.04.25.10.54.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Apr 2011 10:54:23 -0700 (PDT) Date: Mon, 25 Apr 2011 13:54:20 -0400 From: Bob Hall To: "C. P. Ghost" Message-ID: <20110425175420.GA61811@stainmore> Mail-Followup-To: Bob Hall , "C. P. Ghost" , freebsd-questions@freebsd.org References: <20110425151846.0a5359fd@gumby.homeunix.com> <20110425151536.GA61425@stainmore> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-questions@freebsd.org 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 17:54:25 -0000 On Mon, Apr 25, 2011 at 05:46:33PM +0200, C. P. Ghost wrote: > 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.  The 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. Good point. From the man page: "Any such extension beyond the end of the mapped object will be zero-filled." and "A successful mmap deletes any previous mapping in the allocated address range."