From: Ingo Molnar <mingo@elte.hu>
To: pageexec@freemail.hu
Cc: Jakub Jelinek <jakub@redhat.com>, Sam Ravnborg <sam@ravnborg.org>,
Arjan van de Ven <arjan@infradead.org>,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [x86.git#mm] stack protector fixes, vmsplice exploit
Date: Fri, 15 Feb 2008 00:19:17 +0100 [thread overview]
Message-ID: <20080214231917.GB31883@elte.hu> (raw)
In-Reply-To: <47B4D233.23110.5E1523@pageexec.freemail.hu>
* pageexec@freemail.hu <pageexec@freemail.hu> wrote:
> On 14 Feb 2008 at 17:35, Jakub Jelinek wrote:
>
> > Where do you see a mispredicted branch?
>
> try it with -Os (gentoo gcc 4.2.2):
>
> 0000000000000000 <foo>:
> 0: 48 83 ec 58 sub $0x58,%rsp
> 4: 65 48 8b 04 25 28 00 00 00 mov %gs:0x28,%rax
> d: 48 89 44 24 48 mov %rax,0x48(%rsp)
> 12: 31 c0 xor %eax,%eax
> 14: 48 89 e7 mov %rsp,%rdi
> 17: e8 00 00 00 00 callq 1c <foo+0x1c> 18: R_X86_64_PC32
> bar+0xfffffffffffffffc
> 1c: 48 8b 54 24 48 mov 0x48(%rsp),%rdx
> 21: 65 48 33 14 25 28 00 00 00 xor %gs:0x28,%rdx
> 2a: b8 06 00 00 00 mov $0x6,%eax
> 2f: 74 05 je 36 <foo+0x36>
> 31: e8 00 00 00 00 callq 36 <foo+0x36> 32: R_X86_64_PC32
> __stack_chk_fail+0xfffffffffffffffc
> 36: 48 83 c4 58 add $0x58,%rsp
> 3a: c3 retq
ah, that's what my kernel uses too - and CONFIG_CC_OPTIMIZE_FOR_SIZE=y
is the default for Fedora too.
hm, especially those big addressing mode mov's and xor's look rather
nasty.
Ingo
next prev parent reply other threads:[~2008-02-14 23:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-14 17:00 Ingo Molnar
2008-02-14 17:16 ` pageexec
2008-02-14 19:00 ` Ingo Molnar
2008-02-14 18:55 ` pageexec
2008-02-14 20:25 ` Ingo Molnar
2008-02-14 21:00 ` Arjan van de Ven
2008-02-14 21:12 ` pageexec
2008-02-14 22:35 ` Jakub Jelinek
2008-02-14 21:43 ` pageexec
2008-02-14 23:19 ` Ingo Molnar [this message]
2008-02-14 23:16 ` Ingo Molnar
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=20080214231917.GB31883@elte.hu \
--to=mingo@elte.hu \
--cc=arjan@infradead.org \
--cc=hpa@zytor.com \
--cc=jakub@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pageexec@freemail.hu \
--cc=sam@ravnborg.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®