cgroup: fix rcu_read_lock() leak in update_if_frozen()
A message that is not in the archive (sent off-list or not yet received): 5369104d.Nn5Lpp7nwOehwnnC%[email protected]
Tejun Heo
maintainerPATCH 1/1 cgroup: fix rcu_read_lock() leak in update_if_frozen()
While updating cgroup_freezer locking, 68fafb77d827 ("cgroup_freezer:
replace freezer->lock with freezer_mutex") introduced a bug in update_if_frozen() where it returns with rcu_read_lock() held. Fix it by adding rcu_read_unlock() before returning.
Signed-off-by Tejun Heo <[email protected]>
Reported-by kbuild test robot <[email protected]>
--- kernel/cgroup_freezer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/cgroup_freezer.c +3 -1
@@ -267,8 +267,10 @@ static void update_if_frozen(struct cgrostruct freezer *child =css_freezer (pos);if ((child->state &CGROUP_FREEZER_ONLINE ) && - !(child->state &CGROUP_FROZEN )) + !(child->state &CGROUP_FROZEN )) { +rcu_read_unlock ();return ; + } }rcu_read_unlock ();
Quoted 7 lines · Tejun Heo
While updating
cgroup_freezerlocking,68fafb77d827("cgroup_freezer:
replacefreezer->lockwithfreezer_mutex") introduced a bug inupdate_if_frozen()where it returns withrcu_read_lock()held. Fix it by addingrcu_read_unlock()before returning.Signed-off-by Tejun Heo <[email protected]>Reported-by kbuild test robot <[email protected]>
Applied to cgroup/for-3.15-fixes.
Thanks.
Signature · 1 line
tejun