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] [day] [month] [year] [list]
Message-ID: <87ftfgrofe.fsf@dja-thinkpad.axtens.net>
Date:   Wed, 12 Feb 2020 23:16:21 +1100
From:   Daniel Axtens <dja@...ens.net>
To:     Christophe Leroy <christophe.leroy@....fr>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linuxppc-dev@...ts.ozlabs.org, kasan-dev@...glegroups.com,
        aneesh.kumar@...ux.ibm.com, bsingharora@...il.com
Cc:     Michael Ellerman <mpe@...erman.id.au>
Subject: Re: [PATCH v6 4/4] powerpc: Book3S 64-bit "heavyweight" KASAN support

Christophe Leroy <christophe.leroy@....fr> writes:

> Le 12/02/2020 à 11:12, Daniel Axtens a écrit :
>> Christophe Leroy <christophe.leroy@....fr> writes:
>> 
>>> Le 12/02/2020 à 06:47, Daniel Axtens a écrit :
>>>> diff --git a/arch/powerpc/include/asm/kasan.h b/arch/powerpc/include/asm/kasan.h
>>>> index fbff9ff9032e..2911fdd3a6a0 100644
>>>> --- a/arch/powerpc/include/asm/kasan.h
>>>> +++ b/arch/powerpc/include/asm/kasan.h
>>>> @@ -2,6 +2,8 @@
>>>>    #ifndef __ASM_KASAN_H
>>>>    #define __ASM_KASAN_H
>>>>    
>>>> +#include <asm/page.h>
>>>> +
>>>>    #ifdef CONFIG_KASAN
>>>>    #define _GLOBAL_KASAN(fn)	_GLOBAL(__##fn)
>>>>    #define _GLOBAL_TOC_KASAN(fn)	_GLOBAL_TOC(__##fn)
>>>> @@ -14,29 +16,41 @@
>>>>    
>>>>    #ifndef __ASSEMBLY__
>>>>    
>>>> -#include <asm/page.h>
>>>> -
>>>>    #define KASAN_SHADOW_SCALE_SHIFT	3
>>>>    
>>>>    #define KASAN_SHADOW_START	(KASAN_SHADOW_OFFSET + \
>>>>    				 (PAGE_OFFSET >> KASAN_SHADOW_SCALE_SHIFT))
>>>>    
>>>> +#ifdef CONFIG_KASAN_SHADOW_OFFSET
>>>>    #define KASAN_SHADOW_OFFSET	ASM_CONST(CONFIG_KASAN_SHADOW_OFFSET)
>>>> +#endif
>>>>    
>>>> +#ifdef CONFIG_PPC32
>>>>    #define KASAN_SHADOW_END	0UL
>>>>    
>>>> -#define KASAN_SHADOW_SIZE	(KASAN_SHADOW_END - KASAN_SHADOW_START)
>>>> +#ifdef CONFIG_KASAN
>>>> +void kasan_late_init(void);
>>>> +#else
>>>> +static inline void kasan_late_init(void) { }
>>>> +#endif
>>>> +
>>>> +#endif
>>>> +
>>>> +#ifdef CONFIG_PPC_BOOK3S_64
>>>> +#define KASAN_SHADOW_END	(KASAN_SHADOW_OFFSET + \
>>>> +				 (RADIX_VMEMMAP_END >> KASAN_SHADOW_SCALE_SHIFT))
>>>> +
>>>> +static inline void kasan_late_init(void) { }
>>>> +#endif
>>>>    
>>>>    #ifdef CONFIG_KASAN
>>>>    void kasan_early_init(void);
>>>>    void kasan_mmu_init(void);
>>>>    void kasan_init(void);
>>>> -void kasan_late_init(void);
>>>>    #else
>>>>    static inline void kasan_init(void) { }
>>>>    static inline void kasan_mmu_init(void) { }
>>>> -static inline void kasan_late_init(void) { }
>>>>    #endif
>>>
>>> Why modify all this kasan_late_init() stuff ?
>>>
>>> This function is only called from kasan init_32.c, it is never called by
>>> PPC64, so you should not need to modify anything at all.
>> 
>> I got a compile error for a missing symbol. I'll repro it and attach it.
>> 
>
> Oops, sorry. I looked too quickly. It is defined in kasan_init_32.c and 
> called from mm/mem.c
>
> We don't have a performance issue here, since this is called only once 
> during startup. Could you define an empty kasan_late_init() in 
> init_book3s_64.c instead ?

Yeah, I can do that, will respin tomorrow.

Would you mind having a quick check of the documentation changes in
patches 2 and 4? I just want to confirm I've accurately captured the
state of ppc32 kasan work.

Thanks!
Daniel
>
> Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ