diff options
Diffstat (limited to 'arch/x86_64/kernel/process.c')
-rw-r--r-- | arch/x86_64/kernel/process.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index dce8bab4306c..e59d1f9d6163 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/ptrace.h> | 34 | #include <linux/ptrace.h> |
35 | #include <linux/utsname.h> | 35 | #include <linux/utsname.h> |
36 | #include <linux/random.h> | 36 | #include <linux/random.h> |
37 | #include <linux/kprobes.h> | ||
37 | 38 | ||
38 | #include <asm/uaccess.h> | 39 | #include <asm/uaccess.h> |
39 | #include <asm/pgtable.h> | 40 | #include <asm/pgtable.h> |
@@ -293,6 +294,14 @@ void exit_thread(void) | |||
293 | { | 294 | { |
294 | struct task_struct *me = current; | 295 | struct task_struct *me = current; |
295 | struct thread_struct *t = &me->thread; | 296 | struct thread_struct *t = &me->thread; |
297 | |||
298 | /* | ||
299 | * Remove function-return probe instances associated with this task | ||
300 | * and put them back on the free list. Do not insert an exit probe for | ||
301 | * this function, it will be disabled by kprobe_flush_task if you do. | ||
302 | */ | ||
303 | kprobe_flush_task(me); | ||
304 | |||
296 | if (me->thread.io_bitmap_ptr) { | 305 | if (me->thread.io_bitmap_ptr) { |
297 | struct tss_struct *tss = &per_cpu(init_tss, get_cpu()); | 306 | struct tss_struct *tss = &per_cpu(init_tss, get_cpu()); |
298 | 307 | ||
@@ -312,6 +321,13 @@ void flush_thread(void) | |||
312 | struct task_struct *tsk = current; | 321 | struct task_struct *tsk = current; |
313 | struct thread_info *t = current_thread_info(); | 322 | struct thread_info *t = current_thread_info(); |
314 | 323 | ||
324 | /* | ||
325 | * Remove function-return probe instances associated with this task | ||
326 | * and put them back on the free list. Do not insert an exit probe for | ||
327 | * this function, it will be disabled by kprobe_flush_task if you do. | ||
328 | */ | ||
329 | kprobe_flush_task(tsk); | ||
330 | |||
315 | if (t->flags & _TIF_ABI_PENDING) | 331 | if (t->flags & _TIF_ABI_PENDING) |
316 | t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32); | 332 | t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32); |
317 | 333 | ||