This reverts commit bf26c018490c ("Prepare to fix racy accesses on task breakpoints"). The patch was fine but we can no longer race with SIGKILL after commit 9899d11f6544 ("ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL"), the __TASK_TRACED tracee can't be woken up and ->ptrace_bps[] can't go away. Now that ptrace_get_breakpoints/ptrace_put_breakpoints have no callers, we can kill them and remove task->ptrace_bp_refcnt.
Showing the changes to kernel (2 of 4 files). Show all
Unified · Split
| @@ -808,7 +808,7 @@ void do_exit(long code) · 807 unmodified lines | ||
| 808 | 808 | /* |
| 809 | 809 | * FIXME: do that only when needed, using sched_exit tracepoint |
| 810 | 810 | */ |
| 811 | − ptrace_put_breakpoints(tsk); | |
| 811 | + flush_ptrace_hw_breakpoint(tsk); | |
| 812 | 812 | |
| 813 | 813 | exit_notify(tsk, group_dead); |
| 814 | 814 | #ifdef CONFIG_NUMA |
| @@ -1221,19 +1221,3 @@ asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, · 1220 unmodified lines | ||
| 1221 | 1221 | return ret; |
| 1222 | 1222 | } |
| 1223 | 1223 | #endif /* CONFIG_COMPAT */ |
| 1224 | − | |
| 1225 | −#ifdef CONFIG_HAVE_HW_BREAKPOINT | |
| 1226 | −int ptrace_get_breakpoints(struct task_struct *tsk) | |
| 1227 | −{ | |
| 1228 | − if (atomic_inc_not_zero(&tsk->ptrace_bp_refcnt)) | |
| 1229 | − return 0; | |
| 1230 | − | |
| 1231 | − return -1; | |
| 1232 | −} | |
| 1233 | − | |
| 1234 | −void ptrace_put_breakpoints(struct task_struct *tsk) | |
| 1235 | −{ | |
| 1236 | − if (atomic_dec_and_test(&tsk->ptrace_bp_refcnt)) | |
| 1237 | − flush_ptrace_hw_breakpoint(tsk); | |
| 1238 | −} | |
| 1239 | −#endif /* CONFIG_HAVE_HW_BREAKPOINT */ | |