diff options
Diffstat (limited to 'patches/0005-ptrace-Remove-arch_ptrace_attach.patch')
-rw-r--r-- | patches/0005-ptrace-Remove-arch_ptrace_attach.patch | 157 |
1 files changed, 0 insertions, 157 deletions
diff --git a/patches/0005-ptrace-Remove-arch_ptrace_attach.patch b/patches/0005-ptrace-Remove-arch_ptrace_attach.patch deleted file mode 100644 index e9e518ef7cdf..000000000000 --- a/patches/0005-ptrace-Remove-arch_ptrace_attach.patch +++ /dev/null @@ -1,157 +0,0 @@ -From: "Eric W. Biederman" <ebiederm@xmission.com> -Date: Thu, 5 May 2022 13:26:38 -0500 -Subject: [PATCH 05/12] ptrace: Remove arch_ptrace_attach - -The last remaining implementation of arch_ptrace_attach is ia64's -ptrace_attach_sync_user_rbs which was added at the end of 2007 in -commit aa91a2e90044 ("[IA64] Synchronize RBS on PTRACE_ATTACH"). - -Reading the comments and examining the code ptrace_attach_sync_user_rbs -has the sole purpose of saving registers to the stack when ptrace_attach -changes TASK_STOPPED to TASK_TRACED. In all other cases arch_ptrace_stop -takes care of the register saving. - -In commit d79fdd6d96f4 ("ptrace: Clean transitions between TASK_STOPPED and TRACED") -modified ptrace_attach to wake up the thread and enter ptrace_stop normally even -when the thread starts out stopped. - -This makes ptrace_attach_sync_user_rbs completely unnecessary. So just -remove it. - -Cc: linux-ia64@vger.kernel.org -Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Link: https://lore.kernel.org/r/20220505182645.497868-5-ebiederm@xmission.com ---- - arch/ia64/include/asm/ptrace.h | 4 -- - arch/ia64/kernel/ptrace.c | 57 ----------------------------------------- - kernel/ptrace.c | 18 ------------ - 3 files changed, 79 deletions(-) - ---- a/arch/ia64/include/asm/ptrace.h -+++ b/arch/ia64/include/asm/ptrace.h -@@ -139,10 +139,6 @@ static inline long regs_return_value(str - #define arch_ptrace_stop_needed() \ - (!test_thread_flag(TIF_RESTORE_RSE)) - -- extern void ptrace_attach_sync_user_rbs (struct task_struct *); -- #define arch_ptrace_attach(child) \ -- ptrace_attach_sync_user_rbs(child) -- - #define arch_has_single_step() (1) - #define arch_has_block_step() (1) - ---- a/arch/ia64/kernel/ptrace.c -+++ b/arch/ia64/kernel/ptrace.c -@@ -618,63 +618,6 @@ void ia64_sync_krbs(void) - } - - /* -- * After PTRACE_ATTACH, a thread's register backing store area in user -- * space is assumed to contain correct data whenever the thread is -- * stopped. arch_ptrace_stop takes care of this on tracing stops. -- * But if the child was already stopped for job control when we attach -- * to it, then it might not ever get into ptrace_stop by the time we -- * want to examine the user memory containing the RBS. -- */ --void --ptrace_attach_sync_user_rbs (struct task_struct *child) --{ -- int stopped = 0; -- struct unw_frame_info info; -- -- /* -- * If the child is in TASK_STOPPED, we need to change that to -- * TASK_TRACED momentarily while we operate on it. This ensures -- * that the child won't be woken up and return to user mode while -- * we are doing the sync. (It can only be woken up for SIGKILL.) -- */ -- -- read_lock(&tasklist_lock); -- if (child->sighand) { -- spin_lock_irq(&child->sighand->siglock); -- if (READ_ONCE(child->__state) == TASK_STOPPED && -- !test_and_set_tsk_thread_flag(child, TIF_RESTORE_RSE)) { -- set_notify_resume(child); -- -- WRITE_ONCE(child->__state, TASK_TRACED); -- stopped = 1; -- } -- spin_unlock_irq(&child->sighand->siglock); -- } -- read_unlock(&tasklist_lock); -- -- if (!stopped) -- return; -- -- unw_init_from_blocked_task(&info, child); -- do_sync_rbs(&info, ia64_sync_user_rbs); -- -- /* -- * Now move the child back into TASK_STOPPED if it should be in a -- * job control stop, so that SIGCONT can be used to wake it up. -- */ -- read_lock(&tasklist_lock); -- if (child->sighand) { -- spin_lock_irq(&child->sighand->siglock); -- if (READ_ONCE(child->__state) == TASK_TRACED && -- (child->signal->flags & SIGNAL_STOP_STOPPED)) { -- WRITE_ONCE(child->__state, TASK_STOPPED); -- } -- spin_unlock_irq(&child->sighand->siglock); -- } -- read_unlock(&tasklist_lock); --} -- --/* - * Write f32-f127 back to task->thread.fph if it has been modified. - */ - inline void ---- a/kernel/ptrace.c -+++ b/kernel/ptrace.c -@@ -1285,10 +1285,6 @@ int ptrace_request(struct task_struct *c - return ret; - } - --#ifndef arch_ptrace_attach --#define arch_ptrace_attach(child) do { } while (0) --#endif -- - SYSCALL_DEFINE4(ptrace, long, request, long, pid, unsigned long, addr, - unsigned long, data) - { -@@ -1297,8 +1293,6 @@ SYSCALL_DEFINE4(ptrace, long, request, l - - if (request == PTRACE_TRACEME) { - ret = ptrace_traceme(); -- if (!ret) -- arch_ptrace_attach(current); - goto out; - } - -@@ -1310,12 +1304,6 @@ SYSCALL_DEFINE4(ptrace, long, request, l - - if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) { - ret = ptrace_attach(child, request, addr, data); -- /* -- * Some architectures need to do book-keeping after -- * a ptrace attach. -- */ -- if (!ret) -- arch_ptrace_attach(child); - goto out_put_task_struct; - } - -@@ -1455,12 +1443,6 @@ COMPAT_SYSCALL_DEFINE4(ptrace, compat_lo - - if (request == PTRACE_ATTACH || request == PTRACE_SEIZE) { - ret = ptrace_attach(child, request, addr, data); -- /* -- * Some architectures need to do book-keeping after -- * a ptrace attach. -- */ -- if (!ret) -- arch_ptrace_attach(child); - goto out_put_task_struct; - } - |