[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080316231751.GB379@tv-sign.ru>
Date: Mon, 17 Mar 2008 02:17:51 +0300
From: Oleg Nesterov <oleg@...sign.ru>
To: Roland McGrath <roland@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Davide Libenzi <davidel@...ilserver.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Ingo Molnar <mingo@...e.hu>,
Laurent Riffard <laurent.riffard@...e.fr>,
Pavel Emelyanov <xemul@...nvz.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init
On 03/16, Roland McGrath wrote:
>
> > Ptracing of /sbin/init is not allowed. Of course, this is very dangerous, but
> > may be useful. Introduce the kernel boot parameter to allow this.
>
> Personally I wouldn't mind losing all the ptrace/signals special cases for
> init. (Just don't have a buggy init and expect not to crash, don't be root
> and kill init, etc.) So this is fine by me. The conservative route of
> changing it only with a boot option is the wise thing to do.
Great.
> > Unless I missed something, ptrace_get_task_struct() is pointless. It does not
> > need to check "pid == 1", ptrace_attach() does this. It doesn't need tasklist.
>
> Agreed. It's a hold-over from when there was more hair in there.
>
> > It should be replaced with the generic find_get_task_by_vpid() which does not
> > exist yet.
>
> I didn't see enough other uses to really warrant it. Most
> find_task_by_vpid calls don't actually do get_task_struct.
> Those that do want to do some other check inside rcu_read_lock
> before deciding to bother with get_task_struct anyway.
> So there is nothing wrong with ptrace just open-coding:
>
> rcu_read_lock();
> child = find_task_by_vpid(pid);
> if (child)
> get_task_struct(child);
> rcu_read_unlock();
proc_task_lookup(), fill_pid(), attach_task_by_pid(), can use the new helper.
But yes sure, we can open-code this.
Oleg.
--
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