Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757052AbZFHQQe (ORCPT ); Mon, 8 Jun 2009 12:16:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756234AbZFHQQ0 (ORCPT ); Mon, 8 Jun 2009 12:16:26 -0400 Received: from mx2.redhat.com ([66.187.237.31]:38506 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756017AbZFHQQ0 (ORCPT ); Mon, 8 Jun 2009 12:16:26 -0400 Date: Mon, 8 Jun 2009 18:12:04 +0200 From: Oleg Nesterov To: David Howells , Roland McGrath Cc: linux-kernel@vger.kernel.org Subject: Q: PTRACE_ATTACH && -EINTR Message-ID: <20090608161204.GA3986@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 937 Lines: 31 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/