From owner-freebsd-questions@FreeBSD.ORG Wed Apr 27 15:24:03 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 C2617106566B for ; Wed, 27 Apr 2011 15:24:03 +0000 (UTC) (envelope-from rjhjr0@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 725D78FC1E for ; Wed, 27 Apr 2011 15:24:03 +0000 (UTC) Received: by yxl31 with SMTP id 31so624336yxl.13 for ; Wed, 27 Apr 2011 08:24:02 -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=9YqmbpJrcEaIgjfC5nl8HF0fTzjd0wL5AobrKmjKDcg=; b=tC5hbJN6MR+gOoWnS1vbXcN9G0oIjn9T/eW+wU2c+B7D5ICe6b2+Jy8Z+AsB/HZdtd FmRcfQWdcGXZBSwdcAfZLMjPAZujj9ILFdiGPzvkH7GmJd9OzK33iNsX13NaEpKnhgJS 29eyOWnycbGLFr5Fp9rhal07thiknMSRTdrs4= 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=ipbWtB0jPkN5GNXHb2rWiwHYXOlfuWpEFVLvhuUzJdZE4UbRzEl9PalK+Et5BY1nMJ 5YBmMTyie9jcc641xAGJNsxQuaip/uP2lz1mn13EBgnCj7Nq6WwaP4vpKpEt1MhI0+FW IEj9Rm1MywanMtDz4//IkPm/1WCS3AyQ6iqZE= Received: by 10.151.47.9 with SMTP id z9mr2019064ybj.306.1303917842616; Wed, 27 Apr 2011 08:24:02 -0700 (PDT) Received: from localhost (ip98-163-115-74.dc.dc.cox.net [98.163.115.74]) by mx.google.com with ESMTPS id q33sm467112yba.13.2011.04.27.08.24.00 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 27 Apr 2011 08:24:01 -0700 (PDT) Date: Wed, 27 Apr 2011 06:14:02 -0400 From: Bob Hall To: RW Message-ID: <20110427095420.GA41208@kongemord.krig.net> Mail-Followup-To: Bob Hall , RW , freebsd-questions@freebsd.org References: <20110425151846.0a5359fd@gumby.homeunix.com> <20110425151536.GA61425@stainmore> <20110425175420.GA61811@stainmore> <20110425232908.4104e026@gumby.homeunix.com> <20110426025614.GA62745@stainmore> <20110426104151.596bcc19@gumby.homeunix.com> <20110427014554.1e4c5281@gumby.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110427014554.1e4c5281@gumby.homeunix.com> User-Agent: Mutt/1.4.2.1i 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: Wed, 27 Apr 2011 15:24:03 -0000 On Tue, Apr 26, 2011 at 11:41 AM, RW wrote: >> The above quote states that the memory not occupied by the remapped >> object is zero filled. Which is to say that memory allocated by >> mmap() is either filled with new data or filled with zeros. > > In context it says: > >     "If len is not a multiple of the page-size, the mapped region > may extend past the specified range.  Any such extension beyond the >     end of the mapped object will be zero-filled." > > To me the most straightforward reading of that is that it's > referring to non-aligned address ranges. > > Your interpretation may well be the intended one, but where would > that leave the anonymous mappings used by malloc? Are we to think > of them as extensions beyond a non-existent mapped object, and thus > infer that they are zero-filled? It's a bit of a stretch from > what's written. malloc() uses either sbrk or mmap to extend the heap. As far as I know, sbrk extends the heap with zero filled memory. According to the man page, mmap extends it either with remapped data, or with remapped data plus additional zero filled memory. This answers the original poster's question. If you've gone on to a different issue then I apologize for not following you.