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: <20241029103316.GBZyC57KGSxyPie3Qu@fat_crate.local>
Date: Tue, 29 Oct 2024 11:33:16 +0100
From: Borislav Petkov <bp@...en8.de>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	Arnd Bergmann <arnd@...db.de>, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
	"H. Peter Anvin" <hpa@...or.com>,
	Mario Limonciello <mario.limonciello@....com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Yazen Ghannam <yazen.ghannam@....com>,
	Suma Hegde <suma.hegde@....com>,
	Naveen Krishna Chatradhi <naveenkrishna.chatradhi@....com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] platform/x86/amd/hsmp: fix compile-testing without
 CONFiG_AMD_NB

On Tue, Oct 29, 2024 at 09:23:20AM +0000, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
> 
> node_to_amd_nb() is defined to NULL in non-AMD configs:
> 
> drivers/platform/x86/amd/hsmp/plat.c: In function 'init_platform_device':
> drivers/platform/x86/amd/hsmp/plat.c:165:68: error: dereferencing 'void *' pointer [-Werror]
>   165 |                 sock->root                      = node_to_amd_nb(i)->root;
>       |                                                                    ^~
> drivers/platform/x86/amd/hsmp/plat.c:165:68: error: request for member 'root' in something not a structure or union
> 
> Change the definition to something that builds. This does introduce a
> NULL pointer dereference but the code is never called since the driver
> won't probe successfully.
> 
> Fixes: 7d3135d16356 ("platform/x86/amd/hsmp: Create separate ACPI, plat and common drivers")
         ^^^^^^^^^^^^

I'm guessing this is queued for 6.13...

> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  arch/x86/include/asm/amd_nb.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h
> index 6f3b6aef47ba..d0caac26533f 100644
> --- a/arch/x86/include/asm/amd_nb.h
> +++ b/arch/x86/include/asm/amd_nb.h
> @@ -116,7 +116,10 @@ static inline bool amd_gart_present(void)
>  
>  #define amd_nb_num(x)		0
>  #define amd_nb_has_feature(x)	false
> -#define node_to_amd_nb(x)	NULL
> +static inline struct amd_northbridge *node_to_amd_nb(int node)
> +{
> +	return NULL;
> +}
>  #define amd_gart_present(x)	false

... so this fix should go to Linus now so that build testing doesn't break?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ