lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 25 Jun 2011 16:15:53 +0200
From:	Tejun Heo <tj@...nel.org>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	hch@...radead.org
Subject: Re: [PATCH 2/8] kill tracehook_notify_death()

Hello,

On Thu, Jun 23, 2011 at 07:06:50PM +0200, Oleg Nesterov wrote:
> [PATCH v2 2/8] kill tracehook_notify_death()
> 
> Kill tracehook_notify_death(), reimplement the logic in its caller,
> exit_notify().
> 
> Also, change the exec_id's check to use thread_group_leader() instead
> of task_detached(), this is more clear. This logic only applies to
> the exiting leader, a sub-thread must never change its exit_signal.
> 
> Note: when the traced group leader exits the exit_signal-or-SIGCHLD
> logic looks really strange:
> 
> 	- we notify the tracer even if !thread_group_empty() but
> 	   do_wait(WEXITED) can't work until all threads exit

Yeap, we've discussed this before and this indeed is odd.  However, is
there something ptracer can't do with PTRACE_EVENT_EXIT instead?  If
PTRACE_EVENT_EXIT can be used instead for most practical purposes, I
think we're better off just documenting the fact and advise use of
PTRACE_EVENT_EXIT rather than trying to change the behavior.

> 	- if the tracer is real_parent, it is not clear why can't
> 	  we use ->exit_signal event if !thread_group_empty()

I've been thinking a bit more about this and it doesn't seem that
changing this is necessarily a good idea.  The current behavior does
make certain sense (overridden exit_signal is used only for the real
parent when the process is being reaped) and doesn't cause any actual
problem, so I don't think we need to change this behavior.

> +	if (unlikely(tsk->ptrace)) {
> +		int sig = thread_group_leader(tsk) &&
> +				thread_group_empty(tsk) &&
> +				!ptrace_reparented(tsk) ?
> +			tsk->exit_signal : SIGCHLD;

Heh, I think this needs to be prettier even at the cost of an inline
function.

Thanks.

-- 
tejun
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ