History

fork: support VMAP_STACK with KASAN_VMALLOC

Supporting VMAP_STACK with KASAN_VMALLOC is straightforward: - clear the shadow region of vmapped stacks when swapping them in - tweak Kconfig to allow VMAP_STACK to be turned on with KASAN

Daniel Axtens committed 6 years ago

Commit eafb1491 parent 06513912 files · +9 −4Browse files

Showing the changes to kernel (1 of 2 files). Show all

Unified · Split

kernel/fork.c+4−0
@@ -93,6 +93,7 @@ · 92 unmodified lines
93#include <linux/livepatch.h>93#include <linux/livepatch.h>
94#include <linux/thread_info.h>94#include <linux/thread_info.h>
95#include <linux/stackleak.h>95#include <linux/stackleak.h>
96#include <linux/kasan.h>
96 97
97#include <asm/pgtable.h>98#include <asm/pgtable.h>
98#include <asm/pgalloc.h>99#include <asm/pgalloc.h>
@@ -223,6 +224,9 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node) · 124 unmodified lines
223 if (!s)224 if (!s)
224 continue;225 continue;
225 226
227 /* Clear the KASAN shadow of the stack. */
228 kasan_unpoison_shadow(s->addr, THREAD_SIZE);
229
226 /* Clear stale pointers from reused stack. */230 /* Clear stale pointers from reused stack. */
227 memset(s->addr, 0, THREAD_SIZE);231 memset(s->addr, 0, THREAD_SIZE);
228 232

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t