From owner-freebsd-threads@FreeBSD.ORG Fri Sep 16 03:20:09 2011 Return-Path: Delivered-To: freebsd-threads@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F670106564A for ; Fri, 16 Sep 2011 03:20:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8F7D28FC14 for ; Fri, 16 Sep 2011 03:20:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p8G3K97C089468 for ; Fri, 16 Sep 2011 03:20:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p8G3K90A089467; Fri, 16 Sep 2011 03:20:09 GMT (envelope-from gnats) Date: Fri, 16 Sep 2011 03:20:09 GMT Message-Id: <201109160320.p8G3K90A089467@freefall.freebsd.org> To: freebsd-threads@FreeBSD.org From: Peter Wemm Cc: Subject: Re: threads/160708: Bypass process stack quota :) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Wemm List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2011 03:20:09 -0000 The following reply was made to PR threads/160708; it has been noted by GNATS. From: Peter Wemm 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