summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authoreggz2020-07-18 17:50:55 +0200
committereggz2020-07-18 17:50:55 +0200
commitecfc6362e0aecaf9c35137be354a2bf568a5a850 (patch)
tree34839d866210f8f39a3b99e6e628f88120f43990
parentd6ab0f93569e69e8685f966a88d73f2be0075cf0 (diff)
downloadaur-ecfc6362e0aecaf9c35137be354a2bf568a5a850.tar.gz
clean it up
Signed-off-by: eggz <egnappah@gmail.com>
-rw-r--r--stackcanary.patch65
1 files changed, 0 insertions, 65 deletions
diff --git a/stackcanary.patch b/stackcanary.patch
deleted file mode 100644
index 50e58c8cb371..000000000000
--- a/stackcanary.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-diff --git a/arch/x86/include/asm/stackprotector.h b/arch/x86/include/asm/stackprotector.h
-index 91e29b6a86a5..9804a7957f4e 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 69881b2d446c..9674321ce3a3 100644
---- a/arch/x86/kernel/smpboot.c
-+++ b/arch/x86/kernel/smpboot.c
-@@ -262,6 +262,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 802ee5bba66c..0cebe5db691d 100644
---- a/arch/x86/xen/smp_pv.c
-+++ b/arch/x86/xen/smp_pv.c
-@@ -92,6 +92,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 034b0a644efc..732754d96039 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 */