Skip to content

cgroup: Fix cgroup_mutex deadlock through cgroup_parse_float() oops

Chris Down cgroups lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 1 replyIn review

Changes in v3 from the cover letter

- First public version
- Rebase onto current cgroup/for-7.4-fixes, no code changes

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2cgroup: Fix divide error on long fractions in cgroup_parse_float()kernel/cgroup/cgroup.c+20 -90 replies
2/2selftests/cgroup: Test parsing of long fractions in cpu.uclamp.mintools/testing/selftests/cgroup/config tools/testing/selftests/cgroup/test_cpu.c+75 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] cgroup: Fix cgroup_mutex deadlock through cgroup_parse_float() oops

With CONFIG_UCLAMP_TASK_GROUP=y on x86_64 it is possible to get cgroup_parse_float() to oops by writing 0.00... to cpu.uclamp.min.

This alone is not great, but it's even worse because the dead writer leaves the kernfs active reference held, so cgroup_mutex gets stuck completely. It's also triggerable by unprivileged users on delegated subtrees.

v3:

- First public version
- Rebase onto current cgroup/for-7.4-fixes, no code changes

v2:

- Only parse the digits after the dot (Tejun)
- Drop the selftest cases for whitespace and signs
- Rebase onto cgroup/for-7.4-fixes

v1 and v2 were sent off-list, so they are not on lore.

Chris Down (2):
cgroup: Fix divide error on long fractions in cgroup_parse_float() selftests/cgroup: Test parsing of long fractions in cpu.uclamp.min

 kernel/cgroup/cgroup.c                    | 29 ++++++---
 tools/testing/selftests/cgroup/config     |  4 ++
 tools/testing/selftests/cgroup/test_cpu.c | 71 +++++++++++++++++++++++
 3 files changed, 95 insertions(+), 9 deletions(-)

base-commit: c99f50e4acf86bfbbe313d79f281d83be1763260

Signature · 1 line
2.56.1