aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMike Kravetz <kravetz@us.ibm.com>2004-08-22 22:26:30 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:26:30 -0700
commit4b4b699dc55425eb582fb233b7815ce0ecd97147 (patch)
tree1498a69ffae64a8b548c2c9cbadcbabe58fe744c /include
parent9026a8d6da2f5a283b988f0748e6324467e12636 (diff)
downloadhistory-4b4b699dc55425eb582fb233b7815ce0ecd97147.tar.gz
[PATCH] proc fs task name locking fix
Races have been observed between excec-time overwriting of task->comm and /proc accesses to the same data. This causes environment string information to appear in /proc. Fix that up by taking task_lock() around updates to and accesses to task->comm. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sched.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ed6acd78eb8b29..65256f313eb695 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -887,6 +887,9 @@ extern int do_execve(char *, char __user * __user *, char __user * __user *, str
extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
extern struct task_struct * copy_process(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
+extern void set_task_comm(struct task_struct *tsk, char *from);
+extern void get_task_comm(char *to, struct task_struct *tsk);
+
#ifdef CONFIG_SMP
extern void wait_task_inactive(task_t * p);
#else
@@ -941,8 +944,8 @@ static inline int thread_group_empty(task_t *p)
extern void unhash_process(struct task_struct *p);
/*
- * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info and synchronises with
- * wait4().
+ * Protects ->fs, ->files, ->mm, ->ptrace, ->group_info, ->comm and
+ * synchronises with wait4().
*
* Nests both inside and outside of read_lock(&tasklist_lock).
* It must not be nested with write_lock_irq(&tasklist_lock),