X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=security%2Fdevice_cgroup.c;h=084c8e417564aced290b90e703ddca2cc6bc3108;hb=5877019d97ab827b808e8759c71ef8d31490907a;hp=ce14a31b1337a28f67479cb2c88306cd371c5978;hpb=ea280e7b408ca0dad195ce9836feccdd1dc32131;p=linux-beck.git diff --git a/security/device_cgroup.c b/security/device_cgroup.c index ce14a31b1337..084c8e417564 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c @@ -589,9 +589,17 @@ static int propagate_exception(struct dev_cgroup *devcg_root, static inline bool has_children(struct dev_cgroup *devcgroup) { - struct cgroup *cgrp = devcgroup->css.cgroup; + bool ret; - return !list_empty(&cgrp->children); + /* + * FIXME: There may be lingering offline csses and this function + * may return %true when there isn't any userland-visible child + * which is incorrect for our purposes. + */ + rcu_read_lock(); + ret = css_next_child(NULL, &devcgroup->css); + rcu_read_unlock(); + return ret; } /*