From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/398 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: malloc and linux memory layout Date: Thu, 11 Aug 2011 10:54:58 -0400 Message-ID: <20110811145458.GE132@brightrain.aerifal.cx> References: <20110810195658.GC132@brightrain.aerifal.cx> <20110811074305.GA4276@albatros> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1313075288 2550 80.91.229.12 (11 Aug 2011 15:08:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 11 Aug 2011 15:08:08 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-399-gllmg-musl=m.gmane.org@lists.openwall.com Thu Aug 11 17:08:05 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QrWrb-0006HG-MX for gllmg-musl@lo.gmane.org; Thu, 11 Aug 2011 17:08:03 +0200 Original-Received: (qmail 32277 invoked by uid 550); 11 Aug 2011 15:08:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32269 invoked from network); 11 Aug 2011 15:08:02 -0000 Content-Disposition: inline In-Reply-To: <20110811074305.GA4276@albatros> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:398 Archived-At: On Thu, Aug 11, 2011 at 11:43:05AM +0400, Vasiliy Kulikov wrote: > > The mmap zone (where mmaps are put by > > default) starts just below the stack limit and continues downward as > > more mappings are made. > > Not only this zone. mmap() can return address before main program text if > there is enough space there. Interesting. > Other minor (Linux-specific) things: > > Low unmappable pages region might be absent if the task has CAP_SYS_RAWIO > capability. But pages before mmap_min_addr will be mmap'ed only by > explicit mmap(addr, ..., MAP_FIXED, ...), no libs will be there. This is mostly irrelevant since it requires root or equivalent. (CAP_SYS_RAWIO might as well be root since it lets you exploit kernelspace null pointer dereference bugs to get root). > "Reserved for kernelspace use" region might be absent too for 32-bit > tasks running on 286-64 system. Nice. Rich