diff options
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index b9d3bc6c21ec..ad7e51488291 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -97,6 +97,14 @@ static void __exit_signal(struct task_struct *tsk) | |||
97 | sig->tty = NULL; | 97 | sig->tty = NULL; |
98 | } else { | 98 | } else { |
99 | /* | 99 | /* |
100 | * This can only happen if the caller is de_thread(). | ||
101 | * FIXME: this is the temporary hack, we should teach | ||
102 | * posix-cpu-timers to handle this case correctly. | ||
103 | */ | ||
104 | if (unlikely(has_group_leader_pid(tsk))) | ||
105 | posix_cpu_timers_exit_group(tsk); | ||
106 | |||
107 | /* | ||
100 | * If there is any task waiting for the group exit | 108 | * If there is any task waiting for the group exit |
101 | * then notify it: | 109 | * then notify it: |
102 | */ | 110 | */ |
@@ -905,6 +913,15 @@ NORET_TYPE void do_exit(long code) | |||
905 | if (unlikely(!tsk->pid)) | 913 | if (unlikely(!tsk->pid)) |
906 | panic("Attempted to kill the idle task!"); | 914 | panic("Attempted to kill the idle task!"); |
907 | 915 | ||
916 | /* | ||
917 | * If do_exit is called because this processes oopsed, it's possible | ||
918 | * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before | ||
919 | * continuing. Amongst other possible reasons, this is to prevent | ||
920 | * mm_release()->clear_child_tid() from writing to a user-controlled | ||
921 | * kernel address. | ||
922 | */ | ||
923 | set_fs(USER_DS); | ||
924 | |||
908 | tracehook_report_exit(&code); | 925 | tracehook_report_exit(&code); |
909 | 926 | ||
910 | validate_creds_for_do_exit(tsk); | 927 | validate_creds_for_do_exit(tsk); |