aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-01-24 12:53:04 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-01-24 12:53:04 -0500
commitb3a20ac279bbf57af1aaaadac86cff13c96abe79 (patch)
treeb558e0dae0f9080749bc3eedce9a8b45d90b7448
parenta0dcbb9b390e90d7cf16be5b06cbd2861c8ded90 (diff)
litmus core: don't leak np_flag upon exec
-rw-r--r--fs/exec.c5
-rw-r--r--include/linux/litmus.h1
-rw-r--r--kernel/litmus.c14
3 files changed, 19 insertions, 1 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 11fe93f736..29498a95ac 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -54,6 +54,8 @@
54#include <asm/uaccess.h> 54#include <asm/uaccess.h>
55#include <asm/mmu_context.h> 55#include <asm/mmu_context.h>
56 56
57#include <linux/litmus.h>
58
57#ifdef CONFIG_KMOD 59#ifdef CONFIG_KMOD
58#include <linux/kmod.h> 60#include <linux/kmod.h>
59#endif 61#endif
@@ -1140,7 +1142,8 @@ int do_execve(char * filename,
1140 if (IS_ERR(file)) 1142 if (IS_ERR(file))
1141 goto out_kfree; 1143 goto out_kfree;
1142 1144
1143 sched_exec(); 1145 sched_exec();
1146 litmus_exec();
1144 1147
1145 bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *); 1148 bprm->p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
1146 1149
diff --git a/include/linux/litmus.h b/include/linux/litmus.h
index 1e85d09ee0..858b2c3ff5 100644
--- a/include/linux/litmus.h
+++ b/include/linux/litmus.h
@@ -130,6 +130,7 @@ void send_scheduler_signals(void);
130void np_mem_kill(struct task_struct *t); 130void np_mem_kill(struct task_struct *t);
131 131
132void litmus_fork(struct task_struct *tsk); 132void litmus_fork(struct task_struct *tsk);
133void litmus_exec(void);
133/* clean up real-time state of a task */ 134/* clean up real-time state of a task */
134void exit_litmus(struct task_struct *dead_tsk); 135void exit_litmus(struct task_struct *dead_tsk);
135 136
diff --git a/kernel/litmus.c b/kernel/litmus.c
index 1966e5fc90..0ea3974e20 100644
--- a/kernel/litmus.c
+++ b/kernel/litmus.c
@@ -797,6 +797,20 @@ void litmus_fork(struct task_struct* p)
797 reinit_litmus_state(p, 0); 797 reinit_litmus_state(p, 0);
798} 798}
799 799
800/* Called upon execve().
801 * current is doing the exec.
802 * Don't let address space specific stuff leak.
803 */
804void litmus_exec(void)
805{
806 struct task_struct* p = current;
807
808 if (is_realtime(p)) {
809 WARN_ON(p->rt_param.inh_task);
810 p->rt_param.np_flag = NULL;
811 }
812}
813
800void exit_litmus(struct task_struct *dead_tsk) 814void exit_litmus(struct task_struct *dead_tsk)
801{ 815{
802 if (is_realtime(dead_tsk)) 816 if (is_realtime(dead_tsk))