diff options
| author | Oleg Nesterov <oleg@redhat.com> | 2014-04-07 18:38:39 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:36:05 -0400 |
| commit | 23aebe1691a3d98a79676db6c0fd813e16478804 (patch) | |
| tree | bd64954577711239c9a4fe43436f449a529eabcb /include/linux | |
| parent | 32ed74a4b968a4faff7aaaff557035ce5d5e70ab (diff) | |
exec: kill bprm->tcomm[], simplify the "basename" logic
Starting from commit c4ad8f98bef7 ("execve: use 'struct filename *' for
executable name passing") bprm->filename can not go away after
flush_old_exec(), so we do not need to save the binary name in
bprm->tcomm[] added by 96e02d158678 ("exec: fix use-after-free bug in
setup_new_exec()").
And there was never need for filename_to_taskname-like code, we can
simply do set_task_comm(kbasename(filename).
This patch has to change set_task_comm() and trace_task_rename() to
accept "const char *", but I think this change is also good.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/binfmts.h | 1 | ||||
| -rw-r--r-- | include/linux/sched.h | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index b4a745d7d9a9..61f29e5ea840 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -44,7 +44,6 @@ struct linux_binprm { | |||
| 44 | unsigned interp_flags; | 44 | unsigned interp_flags; |
| 45 | unsigned interp_data; | 45 | unsigned interp_data; |
| 46 | unsigned long loader, exec; | 46 | unsigned long loader, exec; |
| 47 | char tcomm[TASK_COMM_LEN]; | ||
| 48 | }; | 47 | }; |
| 49 | 48 | ||
| 50 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 | 49 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 6c70645eb3b6..f8497059f88c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -2357,7 +2357,7 @@ extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, i | |||
| 2357 | struct task_struct *fork_idle(int); | 2357 | struct task_struct *fork_idle(int); |
| 2358 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 2358 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
| 2359 | 2359 | ||
| 2360 | extern void set_task_comm(struct task_struct *tsk, char *from); | 2360 | extern void set_task_comm(struct task_struct *tsk, const char *from); |
| 2361 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2361 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
| 2362 | 2362 | ||
| 2363 | #ifdef CONFIG_SMP | 2363 | #ifdef CONFIG_SMP |
