From: David Vrabel <dvrabel@cantab.net>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86-64: don't allow non-canonical addresses to be set for any callback
Date: Wed, 13 Jun 2012 11:51:20 +0100 [thread overview]
Message-ID: <4FD870A8.6030606@cantab.net> (raw)
In-Reply-To: <4FD881530200007800089ACB@nat28.tlf.novell.com>
On 13/06/12 11:02, Jan Beulich wrote:
> Rather than deferring the detection of these to the point where they
> get actually used (the fix for XSA-7, 25480:76eaf5966c05, causing a #GP
> to be raised by IRET, which invokes the guest's [fragile] fail-safe
> callback), don't even allow such to be set.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -736,6 +736,14 @@ int arch_set_info_guest(
> {
> if ( !compat )
> {
> +#ifdef __x86_64__
> + if ( !is_canonical_address(c.nat->user_regs.eip) ||
> + !is_canonical_address(c.nat->event_callback_eip) ||
> + !is_canonical_address(c.nat->syscall_callback_eip) ||
> + !is_canonical_address(c.nat->failsafe_callback_eip) )
> + return -EINVAL;
> +#endif
> +
Would it be better to have
#ifndef __x86_64__
# define is_canonical_address(a) 1
#endif
somewhere?
David
next prev parent reply other threads:[~2012-06-13 10:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 10:02 [PATCH] x86-64: don't allow non-canonical addresses to be set for any callback Jan Beulich
2012-06-13 10:51 ` David Vrabel [this message]
2012-06-13 11:20 ` Jan Beulich
2012-06-18 14:05 ` Keir Fraser
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=4FD870A8.6030606@cantab.net \
--to=dvrabel@cantab.net \
--cc=JBeulich@suse.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).