aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2014-04-07 15:38:30 -0700
committerMoyster <oysterized@gmail.com>2019-05-02 18:16:22 +0200
commitab72d6166db4ba391df7805b556966bafc062d90 (patch)
tree300414a03e202a2df2269d4093b8e29b45ee9fea
parent5180379c2735f48ec8fcfb6af4ce95fe6b8406bb (diff)
exit: move check_stack_usage() to the end of do_exit()
It is not clear why check_stack_usage() is called so early and thus it never checks the stack usage in, say, exit_notify() or flush_ptrace_hw_breakpoint() or other functions which are only called by do_exit(). Move the callsite down to the last preempt_disable/schedule. Change-Id: I0146bdcc09af5cb6df1cbeec42c630fd6210d2d8 Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/exit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 9a00dafd8..2322a47bc 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -833,7 +833,6 @@ void do_exit(long code)
disassociate_ctty(1);
exit_task_namespaces(tsk);
exit_task_work(tsk);
- check_stack_usage();
exit_thread();
/*
@@ -887,6 +886,7 @@ void do_exit(long code)
validate_creds_for_do_exit(tsk);
+ check_stack_usage();
preempt_disable();
if (tsk->nr_dirtied)
__this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied);