lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1458339291-4093-4-git-send-email-bsd@redhat.com>
Date:	Fri, 18 Mar 2016 18:14:50 -0400
From:	Bandan Das <bsd@...hat.com>
To:	tj@...nel.org
Cc:	linux-kernel@...r.kernel.org, kvm@...r.kernel.org, mst@...hat.com,
	jiangshanlai@...il.com, RAPOPORT@...ibm.com
Subject: [RFC PATCH 3/4] cgroup: use spin_lock_irq for cgroup match and attach fns

Since these functions will be called from the worker
thread context, using spin_lock_bh triggers WARN_ONs.

Signed-off-by: Bandan Das <bsd@...hat.com>
---
 kernel/cgroup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 3ffdbb4..24b34e8 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2764,10 +2764,10 @@ bool cgroup_match_groups(struct task_struct *tsk1, struct task_struct *tsk2)
 		if (!root->subsys_mask)
 			continue;
 
-		spin_lock_bh(&css_set_lock);
+		spin_lock_irq(&css_set_lock);
 		cg_tsk1 = task_cgroup_from_root(tsk1, root);
 		cg_tsk2 = task_cgroup_from_root(tsk2, root);
-		spin_unlock_bh(&css_set_lock);
+		spin_unlock_irq(&css_set_lock);
 
 		if (cg_tsk1 != cg_tsk2) {
 			result = false;
@@ -2797,9 +2797,9 @@ int cgroup_attach_task_all(struct task_struct *from, struct task_struct *tsk)
 		if (root == &cgrp_dfl_root)
 			continue;
 
-		spin_lock_bh(&css_set_lock);
+		spin_lock_irq(&css_set_lock);
 		from_cgrp = task_cgroup_from_root(from, root);
-		spin_unlock_bh(&css_set_lock);
+		spin_unlock_irq(&css_set_lock);
 
 		retval = cgroup_attach_task(from_cgrp, tsk, false);
 		if (retval)
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ