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: Wed, 27 Mar 2024 18:10:53 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Alexey Dobriyan <adobriyan@...il.com>
CC: Thomas Gleixner <tglx@...utronix.de>, Peter Zijlstra
	<peterz@...radead.org>, <linux-kernel@...r.kernel.org>, Guenter Roeck
	<linux@...ck-us.net>, <linuxarm@...wei.com>
Subject: Re: [PATCH v2] cpu: mark cpu_possible_mask as __ro_after_init

On Thu, 22 Feb 2024 14:19:35 +0300
Alexey Dobriyan <adobriyan@...il.com> wrote:

> cpu_possible_mask is by definition "cpus which could be hotplugged without
> reboot". It's a property which is fixed after kernel enumerates hardware
> configuration.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>

Causes a crash in this path (via CPU HP testing on qemu)
Pretending to be an AMD Genoa, but I doubt that matters.

topology_hotplug_apic()
-> topo_set_cpuids()
 --> set_cpu_possible(cpu, true);
It should be already set, but the code doesn't check that.

Various possible fixes. Probably easiest is to pass in a 
bool hotplug to topo_set_cpuids() so we don't set the 
possible value if it's coming from hotplug calls.

I can spin a patch, but it will next week probably.

Jonathan

> ---
> 
> 	v2: fix parisc compilation
> 
>  kernel/cpu.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/kernel/cpu.c
> +++ b/kernel/cpu.c
> @@ -3107,10 +3107,10 @@ const DECLARE_BITMAP(cpu_all_bits, NR_CPUS) = CPU_BITS_ALL;
>  EXPORT_SYMBOL(cpu_all_bits);
>  
>  #ifdef CONFIG_INIT_ALL_POSSIBLE
> -struct cpumask __cpu_possible_mask __read_mostly
> +struct cpumask __cpu_possible_mask __ro_after_init
>  	= {CPU_BITS_ALL};
>  #else
> -struct cpumask __cpu_possible_mask __read_mostly;
> +struct cpumask __cpu_possible_mask __ro_after_init;
>  #endif
>  EXPORT_SYMBOL(__cpu_possible_mask);
>  


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ