* [PATCH] ptrace: Remove redundant code in ptrace_attach
@ 2021-01-13 13:44 Marcus Huewe
2021-01-13 15:34 ` Oleg Nesterov
0 siblings, 1 reply; 2+ messages in thread
From: Marcus Huewe @ 2021-01-13 13:44 UTC (permalink / raw)
To: oleg; +Cc: linux-kernel, suse-tux
In case of a PTRACE_SEIZE request, the PT_SEIZED flag is always set
at the beginning of ptrace_attach. Hence, there is no need to set
it again (neither "flags" nor "seize" are modified in between/after
the initial assignment).
Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
---
kernel/ptrace.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 61db50f7ca86..059fce2ad53c 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -402,8 +402,6 @@ static int ptrace_attach(struct task_struct *task, long request,
if (task->ptrace)
goto unlock_tasklist;
- if (seize)
- flags |= PT_SEIZED;
task->ptrace = flags;
ptrace_link(task, current);
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ptrace: Remove redundant code in ptrace_attach
2021-01-13 13:44 [PATCH] ptrace: Remove redundant code in ptrace_attach Marcus Huewe
@ 2021-01-13 15:34 ` Oleg Nesterov
0 siblings, 0 replies; 2+ messages in thread
From: Oleg Nesterov @ 2021-01-13 15:34 UTC (permalink / raw)
To: Marcus Huewe, Andrew Morton; +Cc: linux-kernel
Acked-by: Oleg Nesterov <oleg@redhat.com>
On 01/13, Marcus Huewe wrote:
>
> In case of a PTRACE_SEIZE request, the PT_SEIZED flag is always set
> at the beginning of ptrace_attach. Hence, there is no need to set
> it again (neither "flags" nor "seize" are modified in between/after
> the initial assignment).
>
> Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
> ---
> kernel/ptrace.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/kernel/ptrace.c b/kernel/ptrace.c
> index 61db50f7ca86..059fce2ad53c 100644
> --- a/kernel/ptrace.c
> +++ b/kernel/ptrace.c
> @@ -402,8 +402,6 @@ static int ptrace_attach(struct task_struct *task, long request,
> if (task->ptrace)
> goto unlock_tasklist;
>
> - if (seize)
> - flags |= PT_SEIZED;
> task->ptrace = flags;
>
> ptrace_link(task, current);
> --
> 2.29.2
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-01-13 15:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13 13:44 [PATCH] ptrace: Remove redundant code in ptrace_attach Marcus Huewe
2021-01-13 15:34 ` Oleg Nesterov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).