From: Andrew Morton <akpm@linux-foundation.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Tejun Heo <tj@kernel.org>, Dave Jones <davej@redhat.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
cgroups@vger.kernel.org, Li Zefan <lizefan@huawei.com>
Subject: Re: [PATCH] do not abuse ->cred_guard_mutex in threadgroup_lock()
Date: Thu, 21 Mar 2013 15:06:26 -0700 [thread overview]
Message-ID: <20130321150626.a7934d989fb80d835fa92255@linux-foundation.org> (raw)
In-Reply-To: <20130321162138.GA21859@redhat.com>
On Thu, 21 Mar 2013 17:21:38 +0100 Oleg Nesterov <oleg@redhat.com> wrote:
> threadgroup_lock() takes signal->cred_guard_mutex to ensure that
> thread_group_leader() is stable. This doesn't look nice, the scope
> of this lock in do_execve() is huge.
>
> And as Dave pointed out this can lead to deadlock, we have the
> following dependencies:
>
> do_execve: cred_guard_mutex -> i_mutex
> cgroup_mount: i_mutex -> cgroup_mutex
> attach_task_by_pid: cgroup_mutex -> cred_guard_mutex
>
> Change de_thread() to take threadgroup_change_begin() around the
> switch-the-leader code and change threadgroup_lock() to avoid
> ->cred_guard_mutex.
>
> Note that de_thread() can't sleep with ->group_rwsem held, this
> can obviously deadlock with the exiting leader if the writer is
> active, so it does threadgroup_change_end() before schedule().
<formletter>
When writing a changelog, please describe the end-user-visible effects
of the bug, so that others can more easily decide which kernel
version(s) should be fixed, and so that downstream kernel maintainers
can more easily work out whether this patch will fix a problem which
they or their customers are observing.
</formletter>
> Reported-by: Dave Jones <davej@redhat.com>
Perhaps Dave's report provides the needed info? trinity went titsup?
next prev parent reply other threads:[~2013-03-21 22:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 22:36 lockdep trace from prepare_bprm_creds Dave Jones
2013-03-07 17:25 ` Oleg Nesterov
2013-03-07 18:01 ` Tejun Heo
2013-03-07 18:03 ` Tejun Heo
2013-03-07 19:12 ` Oleg Nesterov
2013-03-07 19:38 ` Tejun Heo
2013-03-09 2:11 ` Li Zefan
2013-03-09 3:29 ` Tejun Heo
2013-03-09 7:47 ` Li Zefan
2013-03-09 20:00 ` [PATCH 0/1] do not abuse ->cred_guard_mutex in threadgroup_lock() Oleg Nesterov
2013-03-09 20:01 ` [PATCH 1/1] " Oleg Nesterov
2013-03-09 20:15 ` Tejun Heo
2013-03-11 1:50 ` Li Zefan
2013-03-21 16:21 ` [PATCH] " Oleg Nesterov
2013-03-21 22:06 ` Andrew Morton [this message]
2013-03-22 13:20 ` Oleg Nesterov
2013-03-19 22:02 ` [PATCH cgroup/for-3.10] cgroup: make cgroup_mutex outer to threadgroup_lock Tejun Heo
2013-03-20 0:58 ` Li Zefan
2013-03-20 15:03 ` Tejun Heo
2013-03-20 18:35 ` Oleg Nesterov
2013-03-20 18:42 ` Tejun Heo
2013-03-21 16:17 ` Oleg Nesterov
2013-03-07 18:21 ` lockdep trace from prepare_bprm_creds Tejun Heo
2013-03-07 18:32 ` Oleg Nesterov
2013-03-07 19:33 ` Tejun Heo
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=20130321150626.a7934d989fb80d835fa92255@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=oleg@redhat.com \
--cc=tj@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome