public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Q: PTRACE_ATTACH && -EINTR
@ 2009-06-08 16:12 Oleg Nesterov
  2009-06-08 17:39 ` Roland McGrath
  0 siblings, 1 reply; 8+ messages in thread
From: Oleg Nesterov @ 2009-06-08 16:12 UTC (permalink / raw)
  To: David Howells, Roland McGrath; +Cc: linux-kernel

I just realized that ->cred_exec_mutex added a user-visible change
which may confuse user-space.

	ptrace_attach:

		retval = mutex_lock_interruptible(&task->cred_exec_mutex);
		if (retval  < 0)
			goto out;

This doesn't look good, we return -EINTR. Suppose that strace tries to
attach to all sub-threads and ptrace(PTRACE_ATTACH) returns -EINTR just
because the already traced thread sends SIGCHLD. Or tracer's sub-thread
does recalc_sigpending_and_wake().

I think we should at least do

		retval = -ERESTARTSYS;
		if (mutex_lock_interruptible(&task->cred_exec_mutex))
			goto out;

Or even -ERESTARTNOINTR ? Or just mutex_lock() ?

Or ignore this problem since nobody complained?

Oleg.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-06-19  2:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-08 16:12 Q: PTRACE_ATTACH && -EINTR Oleg Nesterov
2009-06-08 17:39 ` Roland McGrath
2009-06-08 18:36   ` Oleg Nesterov
2009-06-09  1:44     ` Roland McGrath
2009-06-10 13:11       ` Oleg Nesterov
2009-06-10 17:40         ` Roland McGrath
2009-06-19  0:38           ` [PATCH] cred_guard_mutex: do not return -EINTR to user-space Oleg Nesterov
2009-06-19  2:24             ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox