History

ptrace: kill trivial tracehooks

At this point, tracehooks aren't useful to mainline kernel and mostly just add an extra layer of obfuscation. Although they have comments, without actual in-kernel users, it is difficult to tell what are their assumptions and they're actually trying to achieve. To mainline kernel, they just aren't worth keeping around. This patch kills the following trivial tracehooks. * Ones testing whether task is ptraced. Replace with ->ptrace test. tracehook_expect_breakpoints() tracehook_consider_ignored_signal() tracehook_consider_fatal_signal() * ptrace_event() wrappers. Call directly. tracehook_report_exec() tracehook_report_exit() tracehook_report_vfork_done() * ptrace_release_task() wrapper. Call directly. tracehook_finish_release_task() * noop tracehook_prepare_release_task() tracehook_report_death() This doesn't introduce any behavior change.

Tejun Heo committed 15 years ago

Commit a288eec1 parent f3c04b97 files · +11 −171Browse files

Showing the changes to kernel/exit.c (1 of 7 files). Show all

Unified · Split

kernel/exit.c+2−5
@@ -169,7 +169,6 @@ void release_task(struct task_struct * p) · 168 unmodified lines
169169 struct task_struct *leader;
170170 int zap_leader;
171171 repeat:
172− tracehook_prepare_release_task(p);
173172 /* don't need to get the RCU readlock here - the process is dead and
174173 * can't be modifying its own credentials. But shut RCU-lockdep up */
175174 rcu_read_lock();
@@ -179,7 +178,7 @@ repeat: · 3 unmodified lines
179178 proc_flush_task(p);
180179
181180 write_lock_irq(&tasklist_lock);
182− tracehook_finish_release_task(p);
181+ ptrace_release_task(p);
183182 __exit_signal(p);
184183
185184 /*
@@ -868,8 +867,6 @@ static void exit_notify(struct task_struct *tsk, int group_dead) · 682 unmodified lines
868867 wake_up_process(tsk->signal->group_exit_task);
869868 write_unlock_irq(&tasklist_lock);
870869
871− tracehook_report_death(tsk, signal, cookie, group_dead);
872−
873870 /* If the process is dead, release it - nobody will wait for it */
874871 if (signal == DEATH_REAP)
875872 release_task(tsk);
@@ -924,7 +921,7 @@ NORET_TYPE void do_exit(long code) · 48 unmodified lines
924921 */
925922 set_fs(USER_DS);
926923
927− tracehook_report_exit(&code);
924+ ptrace_event(PTRACE_EVENT_EXIT, code);
928925
929926 validate_creds_for_do_exit(tsk);
930927