From: Borislav Petkov <bp@alien8.de>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: x86@kernel.org, Joerg Roedel <jroedel@suse.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] x86/head/64: Disable stack protection for head$(BITS).o
Date: Fri, 16 Oct 2020 13:17:03 +0200 [thread overview]
Message-ID: <20201016111703.GD8483@zn.tnic> (raw)
In-Reply-To: <20201008191623.2881677-6-nivedita@alum.mit.edu>
On Thu, Oct 08, 2020 at 03:16:23PM -0400, Arvind Sankar wrote:
> On 64-bit, the startup_64_setup_env() function added in
> 866b556efa12 ("x86/head/64: Install startup GDT")
> has stack protection enabled because of set_bringup_idt_handler().
Where? I don't see it.
I have
CONFIG_STACKPROTECTOR=y
# CONFIG_STACKPROTECTOR_STRONG is not set
and a __stack_chk_fail call is nowhere to be found in the resulting
head64.s file.
startup_64_setup_env:
# arch/x86/kernel/head64.c:91: return ptr - (void *)_text + (void *)physaddr;
leaq startup_gdt(%rdi), %rax #, tmp99
# arch/x86/kernel/head64.c:91: return ptr - (void *)_text + (void *)physaddr;
subq $_text, %rax #, tmp101
movq %rax, startup_gdt_descr+2(%rip) # tmp101, startup_gdt_descr.address
# ./arch/x86/include/asm/desc.h:209: asm volatile("lgdt %0"::"m" (*dtr));
#APP
# 209 "./arch/x86/include/asm/desc.h" 1
lgdt startup_gdt_descr(%rip) # startup_gdt_descr
# 0 "" 2
# arch/x86/kernel/head64.c:600: asm volatile("movl %%eax, %%ds\n"
#NO_APP
movl $24, %eax #, tmp102
#APP
# 600 "arch/x86/kernel/head64.c" 1
movl %eax, %ds
movl %eax, %ss
movl %eax, %es
# 0 "" 2
# arch/x86/kernel/head64.c:91: return ptr - (void *)_text + (void *)physaddr;
#NO_APP
leaq bringup_idt_table(%rdi), %r9 #, tmp105
leaq bringup_idt_descr(%rdi), %r8 #, tmp103
leaq vc_no_ghcb(%rdi), %rsi #, tmp107
# arch/x86/kernel/head64.c:91: return ptr - (void *)_text + (void *)physaddr;
subq $_text, %r9 #, _11
subq $_text, %r8 #, _8
subq $_text, %rsi #, tmp109
# arch/x86/kernel/head64.c:572: set_bringup_idt_handler(idt, X86_TRAP_VC, handler);
movq %r9, %rdi # _11,
call set_bringup_idt_handler.constprop.0 #
# arch/x86/kernel/head64.c:575: desc->address = (unsigned long)idt;
movq %r9, 2(%r8) # _11, MEM[(struct desc_ptr *)_8].address
# ./arch/x86/include/asm/desc.h:214: asm volatile("lidt %0"::"m" (*dtr));
#APP
# 214 "./arch/x86/include/asm/desc.h" 1
lidt (%r8) # MEM[(const struct desc_ptr *)_8]
# 0 "" 2
# arch/x86/kernel/head64.c:605: }
#NO_APP
ret
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2020-10-16 11:17 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 19:16 [PATCH v2 0/5] Couple of bugfixes to sev-es series Arvind Sankar
2020-10-08 19:16 ` [PATCH v2 1/5] x86/boot: Initialize boot_params in startup code Arvind Sankar
2020-10-08 19:16 ` [PATCH v2 2/5] x86/boot: Split out command-line related declarations Arvind Sankar
2020-10-08 19:16 ` [PATCH v2 3/5] x86/boot/64: Show original faulting address in case of error Arvind Sankar
2020-10-09 14:42 ` Joerg Roedel
2020-10-08 19:16 ` [PATCH v2 4/5] x86/boot/64: Explicitly map boot_params and command line Arvind Sankar
2020-10-09 14:49 ` Joerg Roedel
2020-10-16 16:27 ` Borislav Petkov
2020-10-16 16:47 ` Arvind Sankar
2020-10-16 17:07 ` Borislav Petkov
2020-10-16 17:20 ` Arvind Sankar
2020-10-16 17:32 ` Borislav Petkov
2020-10-16 20:04 ` [PATCH v3 1/4] " Arvind Sankar
2020-10-16 20:04 ` [PATCH v3 2/4] x86/boot: Initialize boot_params in startup code Arvind Sankar
2020-10-16 20:04 ` [PATCH v3 3/4] x86/boot: Split out command-line related declarations Arvind Sankar
2020-10-16 20:04 ` [PATCH v3 4/4] x86/boot/64: Show original faulting address in case of error Arvind Sankar
2020-10-19 14:51 ` [PATCH v3 1/4] x86/boot/64: Explicitly map boot_params and command line Borislav Petkov
2020-10-19 17:12 ` Arvind Sankar
2020-10-19 17:31 ` Borislav Petkov
2020-10-19 19:44 ` [tip: x86/seves] " tip-bot2 for Arvind Sankar
2020-10-16 21:18 ` [PATCH v2 4/5] " Arvind Sankar
2020-10-16 21:23 ` Borislav Petkov
2020-10-08 19:16 ` [PATCH v2 5/5] x86/head/64: Disable stack protection for head$(BITS).o Arvind Sankar
2020-10-09 14:49 ` Joerg Roedel
2020-10-16 11:17 ` Borislav Petkov [this message]
2020-10-16 12:43 ` Arvind Sankar
2020-10-16 13:15 ` Borislav Petkov
2020-10-16 14:16 ` Arvind Sankar
2020-10-19 19:44 ` [tip: x86/seves] " tip-bot2 for Arvind Sankar
2020-10-10 19:11 ` [PATCH] x86/boot/64: Initialize 5-level paging variables earlier Arvind Sankar
2020-10-10 19:26 ` Arvind Sankar
2020-10-12 14:08 ` Kirill A. Shutemov
2020-10-12 15:35 ` Arvind Sankar
2020-10-13 8:11 ` Borislav Petkov
2020-10-13 8:20 ` Kirill A. Shutemov
2020-10-13 8:33 ` Borislav Petkov
2020-10-13 9:12 ` Kirill A. Shutemov
2020-10-13 9:46 ` Borislav Petkov
2020-10-15 13:52 ` Kirill A. Shutemov
2020-10-16 10:21 ` Borislav Petkov
2020-10-13 8:59 ` Joerg Roedel
2020-10-19 19:44 ` [tip: x86/seves] " tip-bot2 for Arvind Sankar
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=20201016111703.GD8483@zn.tnic \
--to=bp@alien8.de \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=nivedita@alum.mit.edu \
--cc=x86@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