threads/160708: Bypass process stack quota :)
peter at wemm.org
Fri Sep 16 03:20:09 UTC 2011
The following reply was made to PR threads/160708; it has been noted by GNATS.
From: Peter Wemm <peter at wemm.org>
To: freebsd-gnats-submit at freebsd.org
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 at wemm.org; peter at FreeBSD.org; peter at 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
More information about the freebsd-threads