All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vasiliy Kulikov <segoon@openwall.com>
To: Luis Henriques <henrix@camandro.org>
Cc: Miles Lane <miles.lane@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexey Dobriyan <adobriyan@gmail.com>
Subject: Re: Linus GIT - INFO: possible circular locking dependency detected
Date: Sat, 5 Nov 2011 13:31:46 +0400	[thread overview]
Message-ID: <20111105093146.GA14338@albatros> (raw)
In-Reply-To: <20111103204930.GA3599@hades>

(cc'ed Andrew and Alexey)

On Thu, Nov 03, 2011 at 20:49 +0000, Luis Henriques wrote:
> On Thu, Nov 03, 2011 at 11:57:20AM -0400, Miles Lane wrote:
> ...
> 
> I'm hitting the exact same problem, using a minimal .config file (can send
> it if required), by just running "find /".
> 
> I have bisected the problem and found that commit
> aa6afca5bcaba8101f3ea09d5c3e4100b2b9f0e5 seems to be the cause of it.

procfs holds sig->cred_guard_mutex to ensure the target's credentials are
not changed.  It is held for a little timeslice.  From the stack trace I
don't understand how sys_execve() can happen with ->cred_guard_mutex
held:

static struct dentry *proc_lookupfd_common(struct inode *dir,
					   struct dentry *dentry,
					   instantiate_t instantiate)
{
    ...
	if (lock_trace(task))
		goto out;

	result = instantiate(dir, dentry, task, &fd);
	unlock_trace(task);
    ...
}


static int lock_trace(struct task_struct *task)
{
	int err = mutex_lock_killable(&task->signal->cred_guard_mutex);
	if (err)
		return err;
	if (!ptrace_may_access(task, PTRACE_MODE_ATTACH)) {
		mutex_unlock(&task->signal->cred_guard_mutex);
		return -EPERM;
	}
	return 0;
}

proc_lookupfd_common() always exits without ->cred_guard_mutex held.


Thanks,

-- 
Vasiliy Kulikov
http://www.openwall.com - bringing security into open computing environments

  reply	other threads:[~2011-11-05  9:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 15:57 Linus GIT - INFO: possible circular locking dependency detected Miles Lane
2011-11-03 20:49 ` Luis Henriques
2011-11-05  9:31   ` Vasiliy Kulikov [this message]
2011-11-08 23:57     ` Andrew Morton
2011-11-09  0:17       ` Greg KH
2011-11-09  0:40         ` Greg KH
2011-11-09 19:11           ` Luis Henriques
2011-11-09 19:52             ` Peter Zijlstra
2011-11-09 20:05               ` Luis Henriques
2011-11-14 17:27                 ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111105093146.GA14338@albatros \
    --to=segoon@openwall.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=henrix@camandro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miles.lane@gmail.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.