public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Irwin <bill.irwin@oracle.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: Chuck Ebbert <cebbert@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Wanted: simple, safe x86 stack overflow detection
Date: Sat, 3 Mar 2007 17:50:31 -0800	[thread overview]
Message-ID: <20070304015031.GA4224@holomorphy.com> (raw)
In-Reply-To: <20070228204144.GA32316@one.firstfloor.org>

On Wed, Feb 28, 2007 at 09:41:44PM +0100, Andi Kleen wrote:
> I suppose one could have a CONFIG_DEBUG_STACK_OVERFLOW that gets
> the stacks from vmalloc which would catch any overflow with its
> guard pages. This is you would need to change __pa() to handle
> that too because there might be still some drivers that do
> DMA on stack addresses.  Would be somewhat ugly but doable.
> But I have my doubts it is worth it again -- in my experience static
> analysis works well enough to trace them down and 
> there are not that many anyways.

In case anyone wants them, patches against v2.6.21-rc2-116-gbb648a0
for this are available from http://oss.oracle.com/~wli/stack_paranoia/

I only did arch/i386/ as per the Linux tradition, though I could
arrange for other arches easily enough, barring those for which I lack
target platforms. Testbooted on qemu -smp 4 with 64KB vmalloc()'d
stacks and IRQ stacks, compiletested in a couple of other configs.
Translation: very light testing. For me this was about reestablishing
reconnoiter of current mainline and familiarizing myself with qemu.

The patch series goes something like:
$ quilt series | xargs -i grep -nH '^Subj' patches/\{\} | cut -f2 -d/ |
cut -f 4 -d: | cat -n
     1   make stack size configurable
     2   add config option to vmalloc stacks
     3   make IRQ stacks independently configurable
     4   go BUG on vmallocspace in __pa()
     5   dynamically allocate IRQ stacks
     6   arrange for a guard page on cpu 0's IRQ stack

Chuck, is any of this of any use to you?


-- wli

  parent reply	other threads:[~2007-03-04  1:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28 14:27 Wanted: simple, safe x86 stack overflow detection Chuck Ebbert
2007-02-28 16:31 ` Thiago Galesi
2007-02-28 20:41 ` Andi Kleen
2007-02-28 23:20   ` Bill Irwin
2007-02-28 23:36     ` Jan Engelhardt
2007-02-28 23:45       ` Bill Irwin
2007-03-04  1:50   ` Bill Irwin [this message]
2007-03-06 18:59     ` Chuck Ebbert
2007-03-06 19:43       ` Hugh Dickins
2007-03-06 20:34         ` Bill Irwin
2007-03-07  4:28           ` Arjan van de Ven
2007-03-07  6:44             ` Bill Irwin
2007-03-07 12:34               ` Arjan van de Ven
2007-03-07 14:48                 ` Bill Irwin
2007-03-07 15:04                   ` Arjan van de Ven
2007-03-08  7:43                   ` Avi Kivity
2007-03-19 20:53                     ` Eric W. Biederman
2007-03-06 20:06       ` Bill Irwin
2007-03-05  1:18 ` Arnd Bergmann
2007-03-05 12:39   ` Andi Kleen

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=20070304015031.GA4224@holomorphy.com \
    --to=bill.irwin@oracle.com \
    --cc=andi@firstfloor.org \
    --cc=cebbert@redhat.com \
    --cc=linux-kernel@vger.kernel.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