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:   Mon, 10 Oct 2022 09:37:14 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Lin Shengwang <linshengwang1@...wei.com>
Cc:     mingo@...hat.com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, aubrey.li@...ux.intel.com,
        dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com,
        mgorman@...e.de, bristot@...hat.com, vschneid@...hat.com,
        linux-kernel@...r.kernel.org, cj.chengjian@...wei.com
Subject: Re: [PATCH -next] sched/core: Fix the bug that traversal in
 sched_group_cookie_match is wrong

On Sat, Oct 08, 2022 at 10:27:09AM +0800, Lin Shengwang wrote:
> In commit 97886d9dcd86 ("sched: Migration changes for core scheduling"),
> sched_group_cookie_match() was added to help finding cookie matched
> group, but was inconsistent with the actual purpose.
> 
> Using cpu_rq(cpu) instead of rq to fix the bug.
> 
> Fixes: 97886d9dcd86 ("sched: Migration changes for core scheduling")
> Signed-off-by: Lin Shengwang <linshengwang1@...wei.com>
> ---
>  kernel/sched/sched.h | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
> index 23c6f9f42ba1..1ba602139840 100644
> --- a/kernel/sched/sched.h
> +++ b/kernel/sched/sched.h

> @@ -1269,7 +1277,7 @@ static inline bool sched_group_cookie_match(struct rq *rq,
>  		return true;
>  
>  	for_each_cpu_and(cpu, sched_group_span(group), p->cpus_ptr) {
> -		if (sched_core_cookie_match(rq, p))
> +		if (sched_core_cookie_match(cpu_rq(cpu), p))
>  			return true;

Urgh.. Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ