diff options
-rw-r--r-- | include/linux/user-return-notifier.h | 7 | ||||
-rw-r--r-- | kernel/fork.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/user-return-notifier.h b/include/linux/user-return-notifier.h index b6ac056291d7..9c4a445bb43c 100644 --- a/include/linux/user-return-notifier.h +++ b/include/linux/user-return-notifier.h | |||
@@ -26,6 +26,11 @@ static inline void propagate_user_return_notify(struct task_struct *prev, | |||
26 | 26 | ||
27 | void fire_user_return_notifiers(void); | 27 | void fire_user_return_notifiers(void); |
28 | 28 | ||
29 | static inline void clear_user_return_notifier(struct task_struct *p) | ||
30 | { | ||
31 | clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY); | ||
32 | } | ||
33 | |||
29 | #else | 34 | #else |
30 | 35 | ||
31 | struct user_return_notifier {}; | 36 | struct user_return_notifier {}; |
@@ -37,6 +42,8 @@ static inline void propagate_user_return_notify(struct task_struct *prev, | |||
37 | 42 | ||
38 | static inline void fire_user_return_notifiers(void) {} | 43 | static inline void fire_user_return_notifiers(void) {} |
39 | 44 | ||
45 | static inline void clear_user_return_notifier(struct task_struct *p) {} | ||
46 | |||
40 | #endif | 47 | #endif |
41 | 48 | ||
42 | #endif | 49 | #endif |
diff --git a/kernel/fork.c b/kernel/fork.c index 266c6af6ef1b..1b7512d5a64a 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -64,6 +64,7 @@ | |||
64 | #include <linux/magic.h> | 64 | #include <linux/magic.h> |
65 | #include <linux/perf_event.h> | 65 | #include <linux/perf_event.h> |
66 | #include <linux/posix-timers.h> | 66 | #include <linux/posix-timers.h> |
67 | #include <linux/user-return-notifier.h> | ||
67 | 68 | ||
68 | #include <asm/pgtable.h> | 69 | #include <asm/pgtable.h> |
69 | #include <asm/pgalloc.h> | 70 | #include <asm/pgalloc.h> |
@@ -249,6 +250,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig) | |||
249 | goto out; | 250 | goto out; |
250 | 251 | ||
251 | setup_thread_stack(tsk, orig); | 252 | setup_thread_stack(tsk, orig); |
253 | clear_user_return_notifier(tsk); | ||
252 | stackend = end_of_stack(tsk); | 254 | stackend = end_of_stack(tsk); |
253 | *stackend = STACK_END_MAGIC; /* for overflow detection */ | 255 | *stackend = STACK_END_MAGIC; /* for overflow detection */ |
254 | 256 | ||