public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Irwin <bill.irwin@oracle.com>
To: Chuck Ebbert <cebbert@redhat.com>
Cc: Bill Irwin <bill.irwin@oracle.com>,
	Andi Kleen <andi@firstfloor.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Wanted: simple, safe x86 stack overflow detection
Date: Tue, 6 Mar 2007 12:06:50 -0800	[thread overview]
Message-ID: <20070306200650.GB18774@holomorphy.com> (raw)
In-Reply-To: <45EDBA1B.8050007@redhat.com>

Bill Irwin wrote:
>> Chuck, is any of this of any use to you?

On Tue, Mar 06, 2007 at 01:59:39PM -0500, Chuck Ebbert wrote:
> I said "simple." :)
> In the 4k/4k stack i386 kernel, is there any fundamental reason it
> can't be 4k/8k? We seem to be mostly hitting problems in overflowing
> the IRQ stack... I think. Overhead would only be 4k per CPU for that.

current is derived from current_thread_info()->task which is in turn
derived from the stack pointer. Using segmentation to derive per-thread
state would allow i386 to make IRQ and task stack-sizes independent.
There are beginnings of this in the i386 PDA code.

A patch to allow 8K/8K is relatively simple and may serve your
purposes. vmalloc() of the task and IRQ stacks has negative
performance and resource scalability implications, though it's not
particularly involved. It also ensures no memory corruption can occur
from stack overflow save in the case of stack frames larger than a
page, where furthermore the procedure references distant locations
prior to close ones, such as a reverse array walk. Allowing larger
stacksizes than 8K doesn't seem to be of interest to you, probably due
to the negative resource scalability implications, though it may
stabilize some workloads.

I'm not sure what to say on the simplicity front apart from patches
consisting largely of Kconfig edits are demonstrably simple. There
really wasn't much to any of this from my POV, but I do understand
that others may differ particularly on the stack vmalloc() front.
The individual patches of the series are mostly independent save for
textual affairs, and I intended for users to cherrypick whatever
strategies they preferred as per the config options provided. An
individual patch for the preferred strategy can also be respun in
isolation, if any of those provided are considered desirable.

Otherwise I suppose I can actually make use of the PDA to make the
IRQ stacksize independent of the task stacksize.


-- wli

  parent reply	other threads:[~2007-03-06 20:07 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
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 [this message]
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=20070306200650.GB18774@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