[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTi=ST3TZq2FaMfPG8h6ug+e-Q_98CA@mail.gmail.com>
Date: Tue, 28 Jun 2011 02:31:08 +0200
From: Denys Vlasenko <vda.linux@...glemail.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Tejun Heo <tj@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ptrace: make former thread ID available via
PTRACE_GETEVENTMSG after PTRACE_EVENT_EXEC stop (v.2)
On Sun, Jun 26, 2011 at 10:04 PM, Oleg Nesterov <oleg@...hat.com> wrote:
>> + pid_t old_pid = old_pid; /* for compiler */
>
> we have uninitialized_var() for this,
>
> pid_t uninitialized_var(old_pid);
>
>> - retval = fn(bprm, regs);
>> + if (task_ptrace(current) & PT_PTRACED) {
>
> May be PT_TRACE_EXEC makes more sense. Note that ptrace_event_enabled() was
> recently added.
>
>> + /* Need to fetch pid before load_binary changes it */
>> + rcu_read_lock();
>> + old_pid = task_pid_nr_ns(current, task_active_pid_ns(current->parent));
>
> OK, this looks correct. But imho this code looks strange inside the
> for (;;) loop. Perhaps it would be more clean to record the old pid
> before.
>
>> if (depth == 0)
>> - tracehook_report_exec(fmt, bprm, regs);
>> + tracehook_report_exec(fmt, bprm, regs, old_pid);
>
> Heh, you are out of luck ;) This hook was already killed. Please redo
> against git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc.git ptrace
I just sent rediffed version against this branch as a separate mail.
I think I addressed all your concerns in it.
--
vda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists