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]
Date:	Sat, 31 Mar 2012 13:22:25 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	Peter Zijlstra <peterz@...radead.org>
CC:	Sasha Levin <levinsasha928@...il.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	"linux-kernel@...r.kernel.org List" <linux-kernel@...r.kernel.org>,
	Dave Jones <davej@...hat.com>, mingo@...nel.org,
	"Liu, Chuansheng" <chuansheng.liu@...el.com>, vapier@...too.org,
	rusty@...tcorp.com.au
Subject: Re: sched: WARNING: at include/linux/cpumask.h:108 select_fallback_rq+0x241/0x280()

On 03/30/2012 08:15 PM, Peter Zijlstra wrote:

> On Fri, 2012-03-30 at 19:40 +0530, Srivatsa S. Bhat wrote:
> 
>> From: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
>> Subject: sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()
>>
>> The function for_each_cpu_mask() expects a *pointer* to struct cpumask
>> as its second argument, whereas select_fallback_rq() passes the value
>> itself. And moreover, for_each_cpu_mask() has been marked as obselete
>> in include/linux/cpumask.h. So move to the more appropriate for_each_cpu()
>> variant.
> 
> Gah.. so why did it compile to begin with!?


One of the perils of using macros instead of true function calls :-(


Regards,
Srivatsa S. Bhat

> 
>> Reported-by: Sasha Levin <levinsasha928@...il.com>
>> Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
>> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
>> ---
>>
>>  kernel/sched/core.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index e3ed0ec..e85046d 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -1270,7 +1270,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
>>  	int dest_cpu;
>>  
>>  	/* Look for allowed, online CPU in same node. */
>> -	for_each_cpu_mask(dest_cpu, *nodemask) {
>> +	for_each_cpu(dest_cpu, nodemask) {
>>  		if (!cpu_online(dest_cpu))
>>  			continue;
>>  		if (!cpu_active(dest_cpu))
>> @@ -1281,7 +1281,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
>>  
>>  	for (;;) {
>>  		/* Any allowed, online CPU? */
>> -		for_each_cpu_mask(dest_cpu, *tsk_cpus_allowed(p)) {
>> +		for_each_cpu(dest_cpu, tsk_cpus_allowed(p)) {
>>  			if (!cpu_online(dest_cpu))
>>  				continue;
>>  			if (!cpu_active(dest_cpu))
>>
>>
> 
> 
> 

--
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