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:   Thu, 10 Aug 2023 16:56:11 +0530
From:   Vasant Hegde <vasant.hegde@....com>
To:     Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org
Cc:     x86@...nel.org, dave.hansen@...ux.intel.com, bp@...en8.de,
        mingo@...hat.com,
        Dheeraj Kumar Srivastava <dheerajkumar.srivastava@....com>
Subject: Re: [PATCH] x86/smp: Validate APIC ID before parking CPU in INIT

Hi,


On 8/10/2023 12:22 AM, Thomas Gleixner wrote:
> On Wed, Aug 09 2023 at 20:42, Thomas Gleixner wrote:
>> On Wed, Jul 19 2023 at 05:13, Vasant Hegde wrote:
>>> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
>>> index e1aa2cd7734b..e5ca0689c4dd 100644
>>> --- a/arch/x86/kernel/smpboot.c
>>> +++ b/arch/x86/kernel/smpboot.c
>>> @@ -1360,7 +1360,7 @@ bool smp_park_other_cpus_in_init(void)
>>>  		if (cpu == this_cpu)
>>>  			continue;
>>>  		apicid = apic->cpu_present_to_apicid(cpu);
>>> -		if (apicid == BAD_APICID)
>>> +		if (apicid == BAD_APICID || !apic->apic_id_valid(apicid))
>>>  			continue;
>>>  		send_init_sequence(apicid);
>>>  	}
> 
> I think this papers over the underlying problem that this sends INIT to
> an APIC which was never booted. The below is curing the root cause.

I have tested below patch and it fixes the issue. Thanks

Tested-by: Vasant Hegde <vasant.hegde@....com>

-Vasant

> 
> Thanks,
> 
>         tglx
> ---
> --- a/arch/x86/kernel/smpboot.c
> +++ b/arch/x86/kernel/smpboot.c
> @@ -1356,7 +1356,7 @@ bool smp_park_other_cpus_in_init(void)
>  	if (this_cpu)
>  		return false;
>  
> -	for_each_present_cpu(cpu) {
> +	for_each_cpu_and(cpu, &cpus_booted_once_mask, cpu_present_mask) {
>  		if (cpu == this_cpu)
>  			continue;
>  		apicid = apic->cpu_present_to_apicid(cpu);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ