Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 637146 Details for
Bug 721734
sys-kernel/gentoo-sources:5.6.11 panics in startup when build with gcc-10.0.1
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for gentoo-sources-5.6.11 compiled with gcc-10.0.1
kernel.patch (text/plain), 2.30 KB, created by
Harris Landgarten
on 2020-05-09 17:22:17 UTC
(
hide
)
Description:
patch for gentoo-sources-5.6.11 compiled with gcc-10.0.1
Filename:
MIME Type:
Creator:
Harris Landgarten
Created:
2020-05-09 17:22:17 UTC
Size:
2.30 KB
patch
obsolete
>diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h >index 91e29b6..9804a79 100644 >--- a/arch/x86/include/asm/stackprotector.h >+++ b/arch/x86/include/asm/stackprotector.h >@@ -55,8 +55,13 @@ > /* > * Initialize the stackprotector canary value. > * >- * NOTE: this must only be called from functions that never return, >+ * NOTE: this must only be called from functions that never return > * and it must always be inlined. >+ * >+ * In addition, it should be called from a compilation unit for which >+ * stack protector is disabled. Alternatively, the caller should not end >+ * with a function call which gets tail-call optimized as that would >+ * lead to checking a modified canary value. > */ > static __always_inline void boot_init_stack_canary(void) > { >diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c >index fe3ab96..4f275ac 100644 >--- a/arch/x86/kernel/smpboot.c >+++ b/arch/x86/kernel/smpboot.c >@@ -266,6 +266,14 @@ static void notrace start_secondary(void *unused) > > wmb(); > cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); >+ >+ /* >+ * Prevent tail call to cpu_startup_entry() because the stack protector >+ * guard has been changed a couple of function calls up, in >+ * boot_init_stack_canary() and must not be checked before tail calling >+ * another function. >+ */ >+ prevent_tail_call_optimization(); > } > > /** >diff --git a/arch/x86/xen/smp_pv.c b/arch/x86/xen/smp_pv.c >index 8fb8a50..f2adb63 100644 >--- a/arch/x86/xen/smp_pv.c >+++ b/arch/x86/xen/smp_pv.c >@@ -93,6 +93,7 @@ asmlinkage __visible void cpu_bringup_and_idle(void) > cpu_bringup(); > boot_init_stack_canary(); > cpu_startup_entry(CPUHP_AP_ONLINE_IDLE); >+ prevent_tail_call_optimization(); > } > > void xen_smp_intr_free_pv(unsigned int cpu) >diff --git a/include/linux/compiler.h b/include/linux/compiler.h >index 034b0a6..732754d 100644 >--- a/include/linux/compiler.h >+++ b/include/linux/compiler.h >@@ -356,4 +356,10 @@ static inline void *offset_to_ptr(const int *off) > /* &a[0] degrades to a pointer: a different type from an array */ > #define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) > >+/* >+ * This is needed in functions which generate the stack canary, see >+ * arch/x86/kernel/smpboot.c::start_secondary() for an example. >+ */ >+#define prevent_tail_call_optimization() asm("") >+ > #endif /* __LINUX_COMPILER_H */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 721734
: 637146