From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Atom2 <ariel.atom2@web2web.at>, Jan Beulich <JBeulich@suse.com>
Subject: Re: [PATCH RFC] x86/traps: Improve hypervisor stack overflow detection
Date: Thu, 19 Nov 2015 17:36:54 +0000 [thread overview]
Message-ID: <564E08B6.8030404@citrix.com> (raw)
In-Reply-To: <1447954456-17855-1-git-send-email-andrew.cooper3@citrix.com>
On 19/11/15 17:34, Andrew Cooper wrote:
> A sample Gentoo compliation of Xen contains
>
> lea -0x1058(%rsp),%rsp
> orq $0x0,(%rsp)
> lea 0x1020(%rsp),%rsp
>
> Whatever the reason for silly code like this, it fools the current stack
> overflow detection logic in the #DF handler (which triggers reliably on the
> 'orq' instruction).
>
> Update the overflow condition to declare an overflow if %esp is anywhere
> within the guard page, rather than just within the upper 8th of the page.
>
> Additionally, check %esp against the expected stack base in all builds.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Atom2 <ariel.atom2@web2web.at>
>
> Currently untested, therefore RFC
>
> Atom2: If you have a free moment, would you mind giving this patch a spin on a
> debug hypervisor? I would expect it to top erroniously informing you that no
> overflow was detected
> ---
Another question is whether, given that the sample above moves the stack
by more than 4k, it would be wise to also guard the 4th currently-spare
page between the primary stack and IST stacks.
~Andrew
next prev parent reply other threads:[~2015-11-19 17:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 17:34 [PATCH RFC] x86/traps: Improve hypervisor stack overflow detection Andrew Cooper
2015-11-19 17:36 ` Andrew Cooper [this message]
2015-11-20 10:56 ` Jan Beulich
2015-11-20 10:54 ` Jan Beulich
2015-11-20 11:03 ` Andrew Cooper
2015-11-20 12:23 ` Jan Beulich
2015-11-20 12:52 ` Andrew Cooper
2015-11-20 13:11 ` Jan Beulich
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=564E08B6.8030404@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=ariel.atom2@web2web.at \
--cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.