]> git.proxmox.com Git - mirror_ubuntu-kernels.git/blobdiff - kernel/fork.c
kasan: don't tag stacks allocated with pagealloc
[mirror_ubuntu-kernels.git] / kernel / fork.c
index c7b4ce9d2647cbc6445c7950c24d2d2828db61fe..35e9894d394c2941a2ebf873494e6e1546834421 100644 (file)
@@ -261,7 +261,7 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node)
                                             THREAD_SIZE_ORDER);
 
        if (likely(page)) {
-               tsk->stack = page_address(page);
+               tsk->stack = kasan_reset_tag(page_address(page));
                return tsk->stack;
        }
        return NULL;
@@ -302,6 +302,7 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk,
 {
        unsigned long *stack;
        stack = kmem_cache_alloc_node(thread_stack_cache, THREADINFO_GFP, node);
+       stack = kasan_reset_tag(stack);
        tsk->stack = stack;
        return stack;
 }