From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 3.4 1/2] cgroup: Take css_set_lock when calling cgroup_css_sets_empty()
Date: Thu, 10 Jan 2013 10:43:09 +0800 [thread overview]
Message-ID: <50EE2ABD.5070404@huawei.com> (raw)
In-Reply-To: <1357743822-21707-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On 2013/1/9 23:03, Hans de Goede wrote:
> As indicated in the comment above cgroup_css_sets_empty the
> css_set_lock must be hold when calling it.
>
> Signed-off-by: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
> kernel/cgroup.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index c908354..59e711a 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -3980,7 +3980,10 @@ static int cgroup_rmdir(struct inode *unused_dir, struct dentry *dentry)
> /* the vfs holds both inode->i_mutex already */
> again:
> mutex_lock(&cgroup_mutex);
> - if (!cgroup_css_sets_empty(cgrp)) {
> + read_lock(&css_set_lock);
> + ret = cgroup_css_sets_empty(cgrp);
This function doesn't exist in 3.4.xx kernel! It was introduced by an
out-of-tree patch, and that patch introduced these two bugs (maybe more).
> + read_unlock(&css_set_lock);
> + if (!ret) {
> mutex_unlock(&cgroup_mutex);
> return -EBUSY;
> }
>
next prev parent reply other threads:[~2013-01-10 2:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-09 15:03 2 bug fixes for the 3.4 cgroup code (v2) Hans de Goede
[not found] ` <1357743822-21707-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-09 15:03 ` [PATCH 3.4 1/2] cgroup: Take css_set_lock when calling cgroup_css_sets_empty() Hans de Goede
[not found] ` <1357743822-21707-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-10 2:43 ` Li Zefan [this message]
[not found] ` <50EE2ABD.5070404-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-01-10 8:49 ` Hans de Goede
2013-01-09 15:03 ` [PATCH 3.4 2/2] cgroup: Fix use after free of cgrp (cgrp->css_sets) (v2) Hans de Goede
-- strict thread matches above, loose matches on Subject: below --
2013-01-09 12:11 [PATCH 3.4 0/2] 2 bug fixes for the 3.4 cgroup code Hans de Goede
[not found] ` <1357733486-1742-1-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-09 12:11 ` [PATCH 3.4 1/2] cgroup: Take css_set_lock when calling cgroup_css_sets_empty() Hans de Goede
[not found] ` <1357733486-1742-2-git-send-email-hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2013-01-09 12:37 ` Hans de Goede
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=50EE2ABD.5070404@huawei.com \
--to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.