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-next>] [day] [month] [year] [list]
Date:   Mon, 29 May 2023 08:50:51 +0700
From:   Bagas Sanjaya <bagasdotme@...il.com>
To:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Regressions <regressions@...ts.linux.dev>,
        Linux x86 <x86@...nel.org>
Cc:     David Woodhouse <dwmw@...zon.co.uk>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Michael Kelley <mikelley@...rosoft.com>,
        Oleksandr Natalenko <oleksandr@...alenko.name>,
        Helge Deller <deller@....de>,
        "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
        Vincent Donnefort <vdonnefort@...gle.com>,
        Bert Karwatzki <spasswolf@....de>
Subject: Fwd: kernel/cpu.c: linux misses the initialization of one CPU
 (off-by-one regression)

Hi,

I notice a regression report on Bugzilla [1]. Quoting from it:

> Since commit 18415f33e2ac4ab382cbca8b5ff82a9036b5bd49 linux misses the initialization of 1 CPU when the CONFIG_NR_CPUS is equal to the actual number of CPUs in the system. One can work around the issue by increasing CONFIG_NR_CPUS or apply the following patch:
> 
> From aa5ef661936655f0d806fdbf2d28fc9513dd5c69 Mon Sep 17 00:00:00 2001
> From: Bert Karwatzki <spasswolf@....de>
> Date: Sun, 28 May 2023 14:35:45 +0200
> Subject: [PATCH] Fix CPU detection when CONFIG_NR_CPUS is equal to the actual
>  number of CPUs.
> 
> Signed-off-by: Bert Karwatzki <spasswolf@....de>
> ---
>  kernel/cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/cpu.c b/kernel/cpu.c
> index 005f863a3d2b..5e900b531827 100644
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -1770,7 +1770,7 @@ static void __init cpuhp_bringup_mask(const struct cpumask *mask, unsigned int n
>  	for_each_cpu(cpu, mask) {
>  		struct cpuhp_cpu_state *st = per_cpu_ptr(&cpuhp_state, cpu);
>  
> -		if (!--ncpus)
> +		if (!ncpus--)
>  			break;
>  
>  		if (cpu_up(cpu, target) && can_rollback_cpu(st)) {
> -- 
> 2.40.1

Anyway, I'm adding it to regzbot:

#regzbot introduced: 18415f33e2ac4a https://bugzilla.kernel.org/show_bug.cgi?id=217498
#regzbot title: Off-by-one CPU initalization when CONFIG_NR_CPUS equal to actual system CPU count

Thanks.

[1]: https://bugzilla.kernel.org/show_bug.cgi?id=217498

-- 
An old man doll... just what I always wanted! - Clara

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ