]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Sep 2022 10:25:27 +0000 (12:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Sep 2022 10:25:27 +0000 (12:25 +0200)
added patches:
cgroup-add-missing-cpus_read_lock-to-cgroup_attach_task_all.patch

queue-5.19/cgroup-add-missing-cpus_read_lock-to-cgroup_attach_task_all.patch [new file with mode: 0644]
queue-5.19/series

diff --git a/queue-5.19/cgroup-add-missing-cpus_read_lock-to-cgroup_attach_task_all.patch b/queue-5.19/cgroup-add-missing-cpus_read_lock-to-cgroup_attach_task_all.patch
new file mode 100644 (file)
index 0000000..ddbadab
--- /dev/null
@@ -0,0 +1,43 @@
+From 43626dade36fa74d3329046f4ae2d7fdefe401c6 Mon Sep 17 00:00:00 2001
+From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+Date: Thu, 25 Aug 2022 17:38:38 +0900
+Subject: cgroup: Add missing cpus_read_lock() to cgroup_attach_task_all()
+
+From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+
+commit 43626dade36fa74d3329046f4ae2d7fdefe401c6 upstream.
+
+syzbot is hitting percpu_rwsem_assert_held(&cpu_hotplug_lock) warning at
+cpuset_attach() [1], for commit 4f7e7236435ca0ab ("cgroup: Fix
+threadgroup_rwsem <-> cpus_read_lock() deadlock") missed that
+cpuset_attach() is also called from cgroup_attach_task_all().
+Add cpus_read_lock() like what cgroup_procs_write_start() does.
+
+Link: https://syzkaller.appspot.com/bug?extid=29d3a3b4d86c8136ad9e [1]
+Reported-by: syzbot <syzbot+29d3a3b4d86c8136ad9e@syzkaller.appspotmail.com>
+Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
+Fixes: 4f7e7236435ca0ab ("cgroup: Fix threadgroup_rwsem <-> cpus_read_lock() deadlock")
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/cgroup/cgroup-v1.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/kernel/cgroup/cgroup-v1.c
++++ b/kernel/cgroup/cgroup-v1.c
+@@ -59,6 +59,7 @@ int cgroup_attach_task_all(struct task_s
+       int retval = 0;
+       mutex_lock(&cgroup_mutex);
++      cpus_read_lock();
+       percpu_down_write(&cgroup_threadgroup_rwsem);
+       for_each_root(root) {
+               struct cgroup *from_cgrp;
+@@ -72,6 +73,7 @@ int cgroup_attach_task_all(struct task_s
+                       break;
+       }
+       percpu_up_write(&cgroup_threadgroup_rwsem);
++      cpus_read_unlock();
+       mutex_unlock(&cgroup_mutex);
+       return retval;
index 3943e7bad57c7afa54db04d896e8a8601b9a58fe..e1eaf412a1edd65f3f7cd4128b5e5a9d5dc33bdf 100644 (file)
@@ -33,3 +33,4 @@ drm-amdgpu-move-nbio-ih_doorbell_range-into-ih-code-for-vega.patch
 drm-amdgpu-move-nbio-sdma_doorbell_range-into-sdma-code-for-vega.patch
 net-find-dst-with-sk-s-xfrm-policy-not-ctl_sk.patch
 dt-bindings-apple-aic-fix-required-item-apple-fiq-index-in-affinity-description.patch
+cgroup-add-missing-cpus_read_lock-to-cgroup_attach_task_all.patch