public inbox for cgroups@vger.kernel.org
 help / color / mirror / Atom feed
* Bug in cgroup_do_mount()?
@ 2017-06-13 14:27 David Howells
       [not found] ` <25030.1497364047-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: David Howells @ 2017-06-13 14:27 UTC (permalink / raw)
  To: tj-DgEjT+Ai2ygdnm+yROfE0A
  Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA, cgroups-u79uwXL29TY76Z2rM5mHXA

I'm having a go at converting cgroups to use my fs_context stuff, and I've
spotted a potential bug in the existing code.  In cgroup_do_mount(), there is
the following snippet:

		mutex_lock(&cgroup_mutex);
		spin_lock_irq(&css_set_lock);

		cgrp = cset_cgroup_from_root(ns->root_cset, root);

		spin_unlock_irq(&css_set_lock);
		mutex_unlock(&cgroup_mutex);

		nsdentry = kernfs_node_dentry(cgrp->kn, dentry->d_sb);

Given that locks must be taken to call cset_cgroup_from_root(), is the value
of cgrp trustworthy once the locks are dropped?

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-13 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-13 14:27 Bug in cgroup_do_mount()? David Howells
     [not found] ` <25030.1497364047-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2017-06-13 15:11   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox