From: Oleg Nesterov <oleg@redhat.com>
To: Marcus Huewe <suse-tux@gmx.de>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ptrace: Remove redundant code in ptrace_attach
Date: Wed, 13 Jan 2021 16:34:08 +0100 [thread overview]
Message-ID: <20210113153408.GA26690@redhat.com> (raw)
In-Reply-To: <53924ce0d6f0c15575b5d7dbef2a8038bc27b4ed.1610544906.git.suse-tux@gmx.de>
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
>
prev parent reply other threads:[~2021-01-13 15:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-13 13:44 [PATCH] ptrace: Remove redundant code in ptrace_attach Marcus Huewe
2021-01-13 15:34 ` Oleg Nesterov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210113153408.GA26690@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suse-tux@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox