Commit 1f817429 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'gcc-plugins-v4.20-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux

Pull stackleak plugin fix from Kees Cook:
 "Fix crash by not allowing kprobing of stackleak_erase() (Alexander
  Popov)"

* tag 'gcc-plugins-v4.20-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
  stackleak: Disable function tracing and kprobes for stackleak_erase()
parents fd3b3e0e ef1a8409
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
*/ */
#include <linux/stackleak.h> #include <linux/stackleak.h>
#include <linux/kprobes.h>
#ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE #ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE
#include <linux/jump_label.h> #include <linux/jump_label.h>
...@@ -47,7 +48,7 @@ int stack_erasing_sysctl(struct ctl_table *table, int write, ...@@ -47,7 +48,7 @@ int stack_erasing_sysctl(struct ctl_table *table, int write,
#define skip_erasing() false #define skip_erasing() false
#endif /* CONFIG_STACKLEAK_RUNTIME_DISABLE */ #endif /* CONFIG_STACKLEAK_RUNTIME_DISABLE */
asmlinkage void stackleak_erase(void) asmlinkage void notrace stackleak_erase(void)
{ {
/* It would be nice not to have 'kstack_ptr' and 'boundary' on stack */ /* It would be nice not to have 'kstack_ptr' and 'boundary' on stack */
unsigned long kstack_ptr = current->lowest_stack; unsigned long kstack_ptr = current->lowest_stack;
...@@ -101,6 +102,7 @@ asmlinkage void stackleak_erase(void) ...@@ -101,6 +102,7 @@ asmlinkage void stackleak_erase(void)
/* Reset the 'lowest_stack' value for the next syscall */ /* Reset the 'lowest_stack' value for the next syscall */
current->lowest_stack = current_top_of_stack() - THREAD_SIZE/64; current->lowest_stack = current_top_of_stack() - THREAD_SIZE/64;
} }
NOKPROBE_SYMBOL(stackleak_erase);
void __used stackleak_track_stack(void) void __used stackleak_track_stack(void)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment