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: <2413ae59-b98f-75c3-639c-0e6119ff6fda@csgroup.eu>
Date:   Tue, 31 May 2022 06:26:56 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Michael Ellerman <mpe@...erman.id.au>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        Erhard Furtner <erhard_f@...lbox.org>
Subject: Re: [PATCH] powerpc/Kconfig: Force THREAD_SHIFT to at least 14 with
 KASAN



Le 31/05/2022 à 08:16, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@...roup.eu> writes:
>> Allthough 14 is the default THREAD_SHIFT when KASAN is selected,
>> taking an old config may keep 13 when CONFIG_EXPERT is selected.
>>
>> Force it to 14 as a minimum when KASAN is selected.
>>
>> Also default to 15 when KASAN on PPC64.
>>
>> Reported-by: Erhard Furtner <erhard_f@...lbox.org>
>> Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
>> ---
>>   arch/powerpc/Kconfig | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> I was thinking of doing it in C, similar to the way arm64 handles it.
> 
> Something like below. It means we always double the stack size when
> KASAN is enabled. I think it's preferable, as it will always work
> regardless of whether the user has an old .config (or is bisectting)?

Yes good idea.

I leave it to you then.

You can therefore also remove the default value for KASAN in Kconfig.

Christophe

> 
> cheers
> 
> diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
> index 125328d1b980..c9735f93f8e6 100644
> --- a/arch/powerpc/include/asm/thread_info.h
> +++ b/arch/powerpc/include/asm/thread_info.h
> @@ -14,12 +14,17 @@
>   
>   #ifdef __KERNEL__
>   
> -#if defined(CONFIG_VMAP_STACK) && CONFIG_THREAD_SHIFT < PAGE_SHIFT
> -#define THREAD_SHIFT		PAGE_SHIFT
> +#ifdef CONFIG_KASAN
> +#define THREAD_SHIFT		(CONFIG_THREAD_SHIFT + 1)
>   #else
>   #define THREAD_SHIFT		CONFIG_THREAD_SHIFT
>   #endif
>   
> +#if defined(CONFIG_VMAP_STACK) && THREAD_SHIFT < PAGE_SHIFT
> +#undef THREAD_SHIFT
> +#define THREAD_SHIFT		PAGE_SHIFT
> +#endif
> +
>   #define THREAD_SIZE		(1 << THREAD_SHIFT)
>   
>   /*
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ