From: Oleg Nesterov <oleg@redhat.com>
To: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Tejun Heo <tj@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] make former thread ID available via PTRACE_GETEVENTMSG after PTRACE_EVENT_EXEC stop
Date: Wed, 8 Jun 2011 20:20:32 +0200 [thread overview]
Message-ID: <20110608182032.GA16264@redhat.com> (raw)
In-Reply-To: <BANLkTin6CmO+PfyGkUL3fg3REGXU=7DS7g@mail.gmail.com>
On 06/08, Denys Vlasenko wrote:
>
> Not sure what kind of locking, if any, I need to put around
> current->parent...
Yes ;)
> @@ -1383,8 +1383,10 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
> */
> bprm->recursion_depth = depth;
> if (retval >= 0) {
> - if (depth == 0)
> - tracehook_report_exec(fmt, bprm, regs);
> + if (depth == 0) {
> + pid_t pid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));
It is not safe to use ->parent. At least you need rcu lock around.
Also. At this point current has already changed its pid, you should
record pid_t before ->load_binary().
And. We have the coding style police, please use scripts/checkpatch.pl
Just in case, I'll be off-line till Monday.
Oleg.
prev parent reply other threads:[~2011-06-08 18:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-08 16:33 [PATCH] make former thread ID available via PTRACE_GETEVENTMSG after PTRACE_EVENT_EXEC stop Denys Vlasenko
2011-06-08 18:20 ` 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=20110608182032.GA16264@redhat.com \
--to=oleg@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=vda.linux@googlemail.com \
/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