LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Boris Ostrovsky" <boris.ostrovsky@oracle.com>
Cc: "xen-devel" <xen-devel@lists.xenproject.org>,
	"Juergen Gross" <jgross@suse.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/2] xen/PVH: Set up GS segment for stack canary
Date: Thu, 17 May 2018 09:02:44 -0600	[thread overview]
Message-ID: <5AFD999402000078001C3B29@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20180517144723.21585-2-boris.ostrovsky@oracle.com>

>>> On 17.05.18 at 16:47, <boris.ostrovsky@oracle.com> wrote:
> @@ -64,6 +67,9 @@ ENTRY(pvh_start_xen)
>  	mov %eax,%es
>  	mov %eax,%ss
>  
> +	mov $PVH_CANARY_SEL,%eax
> +	mov %eax,%gs

I doubt this is needed for 64-bit (you could equally well load zero or leave
in place what's there in that case), and loading the selector before setting
the base address in the descriptor won't have the intended effect.

> @@ -150,9 +170,12 @@ gdt_start:
>  	.quad GDT_ENTRY(0xc09a, 0, 0xfffff) /* __KERNEL_CS */
>  #endif
>  	.quad GDT_ENTRY(0xc092, 0, 0xfffff) /* __KERNEL_DS */
> +	.quad GDT_ENTRY(0x4090, 0, 0x18)    /* PVH_CANARY_SEL */
>  gdt_end:
>  
> -	.balign 4
> +	.balign 16
> +canary:
> +	.fill 24, 1, 0

This is too little space for 64-bit afaict (the canary lives at offset 40 there
if I can trust asm/processor.h).

Jan

  reply	other threads:[~2018-05-17 15:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 14:47 [PATCH v3 0/2] PVH GDT fixes Boris Ostrovsky
2018-05-17 14:47 ` [PATCH v3 1/2] xen/PVH: Set up GS segment for stack canary Boris Ostrovsky
2018-05-17 15:02   ` Jan Beulich [this message]
2018-05-17 17:47     ` Boris Ostrovsky
2018-05-18  7:31       ` Jan Beulich
2018-05-17 14:47 ` [PATCH v3 2/2] xen/PVH: Make GDT selectors PVH-specific Boris Ostrovsky

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=5AFD999402000078001C3B29@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    --subject='Re: [PATCH v3 1/2] xen/PVH: Set up GS segment for stack canary' \
    /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

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).