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]
Message-ID: <87sen63505.ffs@tglx>
Date: Fri, 21 Mar 2025 14:08:58 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Neeraj Upadhyay <Neeraj.Upadhyay@....com>, linux-kernel@...r.kernel.org
Cc: bp@...en8.de, mingo@...hat.com, dave.hansen@...ux.intel.com,
 Thomas.Lendacky@....com, nikunj@....com, Santosh.Shukla@....com,
 Vasant.Hegde@....com, Suravee.Suthikulpanit@....com, David.Kaplan@....com,
 x86@...nel.org, hpa@...or.com, peterz@...radead.org, seanjc@...gle.com,
 pbonzini@...hat.com, kvm@...r.kernel.org, kirill.shutemov@...ux.intel.com,
 huibo.wang@....com, naveen.rao@....com
Subject: Re: [RFC v2 02/17] x86/apic: Initialize Secure AVIC APIC backing page

On Wed, Feb 26 2025 at 14:35, Neeraj Upadhyay wrote:
> @@ -1504,6 +1504,8 @@ static void setup_local_APIC(void)
>  		return;
>  	}
>  
> +	if (apic->setup)
> +		apic->setup();

That's broken for AP bringup. This is invoked from ap_starting()
_before_ anything of the CPU is populated. You _CANNOT_ 

> +static void x2apic_savic_setup(void)
> +{
> +	void *backing_page;
> +	enum es_result ret;
> +	unsigned long gpa;
> +
> +	if (this_cpu_read(apic_backing_page))
> +		return;
> +
> +	backing_page = kzalloc(PAGE_SIZE, GFP_KERNEL);

allocate memory at that point. This was clearly never tested with any
debugging enabled. And no GFP_ATOMIC is not the right thing either.

This allocation has to happen on the control CPU before the AP is kicked
into life.

But the right thing to do is:

struct apic_page __percpu *backing_page __ro_after_init;

and do once on the boot CPU:

    backing_page = alloc_percpu(struct apic_page);

I talk more about that struct apic_page in the context of a subsequent
patch.

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ