2022-11-03 08:05:51

by Guo Ren

[permalink] [raw]
Subject: [PATCH -next V8 04/14] riscv: ptrace: Remove duplicate operation

From: Guo Ren <[email protected]>

The TIF_SYSCALL_TRACE is controlled by a common code, see
kernel/ptrace.c and include/linux/thread.h.

clear_task_syscall_work(child, SYSCALL_TRACE);

Signed-off-by: Guo Ren <[email protected]>
Signed-off-by: Guo Ren <[email protected]>
Reviewed-by: Oleg Nesterov <[email protected]>
---
arch/riscv/kernel/ptrace.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c
index 2ae8280ae475..44f4b1ca315d 100644
--- a/arch/riscv/kernel/ptrace.c
+++ b/arch/riscv/kernel/ptrace.c
@@ -212,7 +212,6 @@ unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)

void ptrace_disable(struct task_struct *child)
{
- clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
}

long arch_ptrace(struct task_struct *child, long request,
--
2.36.1



2022-12-05 09:53:03

by Björn Töpel

[permalink] [raw]
Subject: Re: [PATCH -next V8 04/14] riscv: ptrace: Remove duplicate operation

[email protected] writes:

> From: Guo Ren <[email protected]>
>
> The TIF_SYSCALL_TRACE is controlled by a common code, see
> kernel/ptrace.c and include/linux/thread.h.

^^^ thread_info.h
>
> clear_task_syscall_work(child, SYSCALL_TRACE);
>
> Signed-off-by: Guo Ren <[email protected]>
> Signed-off-by: Guo Ren <[email protected]>
> Reviewed-by: Oleg Nesterov <[email protected]>
> ---
> arch/riscv/kernel/ptrace.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c
> index 2ae8280ae475..44f4b1ca315d 100644
> --- a/arch/riscv/kernel/ptrace.c
> +++ b/arch/riscv/kernel/ptrace.c
> @@ -212,7 +212,6 @@ unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)
>
> void ptrace_disable(struct task_struct *child)
> {
> - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
> }
>
> long arch_ptrace(struct task_struct *child, long request,

This patch is also not neccesary for the series, but should be a
separate cleanup.

2022-12-06 05:09:11

by Guo Ren

[permalink] [raw]
Subject: Re: [PATCH -next V8 04/14] riscv: ptrace: Remove duplicate operation

On Mon, Dec 5, 2022 at 5:34 PM Björn Töpel <[email protected]> wrote:
>
> [email protected] writes:
>
> > From: Guo Ren <[email protected]>
> >
> > The TIF_SYSCALL_TRACE is controlled by a common code, see
> > kernel/ptrace.c and include/linux/thread.h.
>
> ^^^ thread_info.h
> >
> > clear_task_syscall_work(child, SYSCALL_TRACE);
> >
> > Signed-off-by: Guo Ren <[email protected]>
> > Signed-off-by: Guo Ren <[email protected]>
> > Reviewed-by: Oleg Nesterov <[email protected]>
> > ---
> > arch/riscv/kernel/ptrace.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/arch/riscv/kernel/ptrace.c b/arch/riscv/kernel/ptrace.c
> > index 2ae8280ae475..44f4b1ca315d 100644
> > --- a/arch/riscv/kernel/ptrace.c
> > +++ b/arch/riscv/kernel/ptrace.c
> > @@ -212,7 +212,6 @@ unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, unsigned int n)
> >
> > void ptrace_disable(struct task_struct *child)
> > {
> > - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
> > }
> >
> > long arch_ptrace(struct task_struct *child, long request,
>
> This patch is also not neccesary for the series, but should be a
> separate cleanup.
Maybe I would deprecate this patch because the generic entry would
delete the whole ptrace_disable().



--
Best Regards
Guo Ren