From: Bill Irwin <bill.irwin@oracle.com>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: Bill Irwin <bill.irwin@oracle.com>,
linux-kernel@vger.kernel.org, bunk@stusta.de, akpm@osdl.org,
gcoady@gmail.com, zlynx@acm.org, dgc@sgi.com,
alan@lxorguk.ukuu.org.uk, andi@firstfloor.org, hch@infradead.org,
jengelh@linux01.gwdg.de, zwane@infradead.org, neilb@suse.de,
jens.axboe@oracle.com, eric@provenscaling.com,
wli@holomorphy.com
Subject: Re: [3/3] use vmalloc() to arrange guard pages for stacks
Date: Tue, 1 May 2007 09:31:40 -0700 [thread overview]
Message-ID: <20070501163140.GM26598@holomorphy.com> (raw)
In-Reply-To: <463757A3.7010808@redhat.com>
Bill Irwin wrote:
>> This patch introduces CONFIG_DEBUG_STACK, which vmalloc()'s task and IRQ
>> stacks in order to establish guard pages. In such a manner any stack
>> overflow that references pages immediately adjacent to the stack is
>> immediately trapped with a fault, which precludes silent memory corruption
>> or difficult-to-decipher failure modes resulting from stack corruption.
On Tue, May 01, 2007 at 11:07:15AM -0400, Chuck Ebbert wrote:
> Is there a guard page below and above the stack? (I've seen stack underflow
> before, as well as overflow.)
vmallocspace allocations are always separated by at least a page, so
this establishes guard pages both above and below the stack by virtue
of such.
It's also notable that the option establishes guard pages for IRQ stacks
in like fashion.
It's a shame that the resource scalability implications of vmallocspace
allocations prevent this from being useful in production. One could, in
principle, establish guard pages within ZONE_NORMAL, but for 4KB stacks
it's somewhat awkward to dredge up 3 contigous pages, and 4 defeats the
purpose. Alignment with 8KB stacks wants 2 contiguous order 1 pages that
span an order 2 page boundary. I guess I could rewrite the page allocator
(again), but people seem to feel safest with the buddy allocator affairs.
BTW, did the original patches for this prove to be of any use to you?
-- wli
next prev parent reply other threads:[~2007-05-01 16:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-30 23:23 [0/3] i386 stack handling updates Bill Irwin
2007-04-30 23:33 ` [1/3] dynamically allocate IRQ stacks Bill Irwin
2007-04-30 23:37 ` [2/3] unconditional i386 " Bill Irwin
2007-04-30 23:40 ` [3/3] use vmalloc() to arrange guard pages for stacks Bill Irwin
2007-05-01 15:07 ` Chuck Ebbert
2007-05-01 16:31 ` Bill Irwin [this message]
2007-05-01 16:40 ` Chuck Ebbert
2007-05-01 16:47 ` Bill Irwin
2007-05-01 17:04 ` [1/3] dynamically allocate IRQ stacks Heiko Carstens
2007-05-01 17:26 ` Bill Irwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070501163140.GM26598@holomorphy.com \
--to=bill.irwin@oracle.com \
--cc=akpm@osdl.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=andi@firstfloor.org \
--cc=bunk@stusta.de \
--cc=cebbert@redhat.com \
--cc=dgc@sgi.com \
--cc=eric@provenscaling.com \
--cc=gcoady@gmail.com \
--cc=hch@infradead.org \
--cc=jengelh@linux01.gwdg.de \
--cc=jens.axboe@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
--cc=wli@holomorphy.com \
--cc=zlynx@acm.org \
--cc=zwane@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox