Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Roland McGrath
Date: Sunday, March 16, 2008 - 3:31 pm

> Ptracing of /sbin/init is not allowed. Of course, this is very dangerous, but

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.


Agreed.  It's a hold-over from when there was more hair in there.


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();

We are on the way soon to having no arch callers of ptrace_get_task_struct
left, so only the two kernel/ptrace.c uses will survive.  (x86 and ia64
switchovers to arch_ptrace/compat_arch_ptrace are already in the pipeline,
and maybe s390 too.)  So let's worry about the cleanup removing this
function once those wither away.


Thanks,
Roland
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 5/5] ptrace: it is fun to strace /sbin/init, Oleg Nesterov, (Sun Mar 16, 8:54 am)
Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init, Roland McGrath, (Sun Mar 16, 3:31 pm)
Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init, Oleg Nesterov, (Sun Mar 16, 4:17 pm)
Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init, Pavel Machek, (Thu Mar 20, 9:27 am)
Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init, Oleg Nesterov, (Thu Mar 20, 9:57 am)
Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init, Pavel Machek, (Thu Mar 20, 4:25 pm)
Re: [PATCH 5/5] ptrace: it is fun to strace /sbin/init, Oleg Nesterov, (Thu Mar 20, 6:15 pm)