lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140902153301.GA17424@htj.dyndns.org>
Date:	Tue, 2 Sep 2014 11:33:01 -0400
From:	Tejun Heo <tj@...nel.org>
To:	Li Zefan <lizefan@...wei.com>
Cc:	Toralf Förster <toralf.foerster@....de>,
	LKML <linux-kernel@...r.kernel.org>,
	cgroups <cgroups@...r.kernel.org>
Subject: Re: [PATCH 1/2] cgroup: Delay the clearing of cgrp->kn->priv

Hello, Li.

On Tue, Sep 02, 2014 at 06:56:58PM +0800, Li Zefan wrote:
>     for ((; ;))
>     {
>         echo $$ > /cgroup/sub/cgroup.procs
>         ech $$ > /cgce 6f2e0c38c2108a74 ]---
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          copy & paste error?
...
> Reported-by: Toralf Förster <toralf.foerster@....de>
> Signed-off-by: Li Zefan <lizefan@...wei.com>
> ---
> 
> Toralf, Thanks for reporting the bug. I'm not able to repy to your email,
> because I was kicked out of the cgroup mailing list so didn't receive
> emails from mailing list for a week.
> 
> ---
>  kernel/cgroup.c | 19 +++++++++----------
>  1 file changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/kernel/cgroup.c b/kernel/cgroup.c
> index 1c56924..e03fc62 100644
> --- a/kernel/cgroup.c
> +++ b/kernel/cgroup.c
> @@ -4185,6 +4185,15 @@ static void css_release_work_fn(struct work_struct *work)
>  
>  	mutex_unlock(&cgroup_mutex);
>  
> +	/*
> +	 * There are two control paths which try to determine cgroup from
> +	 * dentry without going through kernfs - cgroupstats_build() and
> +	 * css_tryget_online_from_dir().  Those are supported by RCU
> +	 * protecting clearing of cgrp->kn->priv backpointer.
> +	 */
> +	if (!ss && cgroup_parent(cgrp))
> +		RCU_INIT_POINTER(*(void __rcu __force **)&cgrp->kn->priv, NULL);

Can we move the above into the preceding else block?  I don't think
holding cgroup_mutex or not makes any difference here.  Also, why do
we need the cgroup_parent() check?  Do we deref root's kn->priv in the
destruction path?  If so, can you please note that in the comment?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ