Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Sep 2011 03:20:09 GMT
From:      Peter Wemm <peter@wemm.org>
To:        freebsd-threads@FreeBSD.org
Subject:   Re: threads/160708: Bypass process stack quota :)
Message-ID:  <201109160320.p8G3K90A089467@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR threads/160708; it has been noted by GNATS.

From: Peter Wemm <peter@wemm.org>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: threads/160708: Bypass process stack quota :)
Date: Thu, 15 Sep 2011 19:52:18 -0700

 RLIMIT_STACK is more meant as a safety measure against runaway
 processes rather than a security system.
 
 The limit you are looking for is:
 #define	RLIMIT_VMEM	10		/* virtual process size (incl. mmap) */
 
 Given that you can freely move your stack, there is nothing to stop
 you relocating your stack pointer to a blob of memory you got from
 mmap. Or even the data segment.
 
 And that is what RLIMIT_VMEM aka RLIMIT_AS are for.
 
 -- 
 Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV
 "All of this is for nothing if we don't go to the stars" - JMS/B5
 "If Java had true garbage collection, most programs would delete
 themselves upon execution." -- Robert Sewell



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109160320.p8G3K90A089467>