From 0f383c68c34edbd29ccfdcbffc67f962fcec7167 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 18 Dec 2009 02:11:20 +0100 Subject: [PATCH] tracehooks: kill some PT_PTRACED checks No functional changes, preparation for utrace-ptrace. task_ptrace() != 0 if and only if PT_PTRACED bit is set, kill some PT_PTRACED checks in tracehook.h to ensure the result is the same with or without utrace which doesn't set PT_PTRACED. Signed-off-by: Roland McGrath Signed-off-by: Oleg Nesterov --- include/linux/tracehook.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index 10db010..6f3c61c 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h @@ -156,7 +156,7 @@ static inline int tracehook_unsafe_exec(struct task_struct *task) { int unsafe = 0; int ptrace = task_ptrace(task); - if (ptrace & PT_PTRACED) { + if (ptrace) { if (ptrace & PT_PTRACE_CAP) unsafe |= LSM_UNSAFE_PTRACE_CAP; else @@ -178,7 +178,7 @@ static inline int tracehook_unsafe_exec(struct task_struct *task) */ static inline struct task_struct *tracehook_tracer_task(struct task_struct *tsk) { - if (task_ptrace(tsk) & PT_PTRACED) + if (task_ptrace(tsk)) return rcu_dereference(tsk->parent); return NULL; } @@ -492,7 +492,7 @@ static inline int tracehook_get_signal(struct task_struct *task, */ static inline int tracehook_notify_jctl(int notify, int why) { - return notify ?: (current->ptrace & PT_PTRACED) ? why : 0; + return notify ?: task_ptrace(current) ? why : 0; } /** -- 1.7.4