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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 21 Jun 2007 23:02:32 +0530
From:	Srivatsa Vaddagiri <vatsa@...ux.vnet.ibm.com>
To:	Paul Jackson <pj@....com>
Cc:	Ingo Molnar <mingo@...e.hu>, clameter@....com,
	linux-kernel@...r.kernel.org, dino@...ibm.com,
	akpm@...ux-foundation.org
Subject: Re: cpuset attach_task to touch per-cpu kernel threads?

On Thu, Jun 21, 2007 at 10:07:12AM -0700, Paul Jackson wrote:
> Ingo, responding to Srivatsa:
> > > Or maybe allow movement if it 
> > > doesn't result in changing kernel-threads's cpu affinity.
> > 
> > yeah, i'd agree ..
> 
> Good point.  I'd agree too.

Yeah .."allow movement if it doesn't result in changing kernel-threads's cpu 
affinity" sounds good, except it is hard to implement in cpuset's
context I think. For ex: we now have to take additional steps when
changing 'cpus_allowed' of a cpuset such that it doesn't violate any cpu
affinity of kernel threads bound to the cpuset. That itself makes the
implementation complex I think.

How about a simpler patch which bans movement of kernel threads from its
home cpuset (i.e top cpuset)?


Index: current/kernel/cpuset.c
===================================================================
--- current.orig/kernel/cpuset.c	2007-06-21 19:42:18.000000000 +0530
+++ current/kernel/cpuset.c	2007-06-21 22:24:38.000000000 +0530
@@ -881,6 +881,10 @@
 	if (cpus_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed))
 		return -ENOSPC;
 
+	/* Don't allow kernel threads to be moved */
+	if (!tsk->mm)
+		return -EINVAL;
+
 	return security_task_setscheduler(tsk, 0, NULL);
 }
 

This probably catches exiting user-space tasks also (whose ->mm pointer is 
null).  Hmm ..there should be a better check for kernel threads.


-- 
Regards,
vatsa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ