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:   Mon, 21 Jun 2021 22:22:22 +0100
From:   Dmitry Safonov <dima@...sta.com>
To:     Christophe Leroy <christophe.leroy@...roup.eu>,
        linux-kernel@...r.kernel.org
Cc:     Dmitry Safonov <0x7f454c46@...il.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andy Lutomirski <luto@...nel.org>,
        Arnd Bergmann <arnd@...db.de>, Borislav Petkov <bp@...en8.de>,
        Catalin Marinas <catalin.marinas@....com>,
        Guo Ren <guoren@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
        Ingo Molnar <mingo@...hat.com>,
        Oleg Nesterov <oleg@...hat.com>,
        Russell King <linux@...linux.org.uk>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Thomas Gleixner <tglx@...utronix.de>,
        Vincenzo Frascino <vincenzo.frascino@....com>,
        Will Deacon <will@...nel.org>, x86@...nel.org,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Michael Ellerman <mpe@...erman.id.au>,
        Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH v3 22/23] powerpc/vdso: Migrate native signals to generic
 vdso_base

Hi Chirstophe,

On 6/17/21 8:34 AM, Christophe Leroy wrote:
> 
> 
> Le 17/06/2021 à 08:36, Christophe Leroy a écrit :
>>
>>
>> Le 11/06/2021 à 20:02, Dmitry Safonov a écrit :
>>> Generic way to track the land vma area.
>>> Stat speaks for itself.
>>>
>>> Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
>>> Cc: Michael Ellerman <mpe@...erman.id.au>
>>> Cc: Paul Mackerras <paulus@...ba.org>
>>> Signed-off-by: Dmitry Safonov <dima@...sta.com>
>>
>>
>> Build failure:
>>
>>    CC      arch/powerpc/kernel/asm-offsets.s
>> In file included from ./include/linux/mmzone.h:21,
>>                   from ./include/linux/gfp.h:6,
>>                   from ./include/linux/xarray.h:14,
>>                   from ./include/linux/radix-tree.h:19,
>>                   from ./include/linux/fs.h:15,
>>                   from ./include/linux/compat.h:17,
>>                   from arch/powerpc/kernel/asm-offsets.c:14:
>> ./include/linux/mm_types.h: In function 'init_vdso_base':
>> ./include/linux/mm_types.h:522:28: error: 'TASK_SIZE_MAX' undeclared
>> (first use in this function); did you mean 'XATTR_SIZE_MAX'?
>>    522 | #define UNMAPPED_VDSO_BASE TASK_SIZE_MAX
>>        |                            ^~~~~~~~~~~~~
>> ./include/linux/mm_types.h:627:40: note: in expansion of macro
>> 'UNMAPPED_VDSO_BASE'
>>    627 |         mm->vdso_base = (void __user *)UNMAPPED_VDSO_BASE;
>>        |                                        ^~~~~~~~~~~~~~~~~~
>> ./include/linux/mm_types.h:522:28: note: each undeclared identifier is
>> reported only once for each function it appears in
>>    522 | #define UNMAPPED_VDSO_BASE TASK_SIZE_MAX
>>        |                            ^~~~~~~~~~~~~
>> ./include/linux/mm_types.h:627:40: note: in expansion of macro
>> 'UNMAPPED_VDSO_BASE'
>>    627 |         mm->vdso_base = (void __user *)UNMAPPED_VDSO_BASE;
>>        |                                        ^~~~~~~~~~~~~~~~~~
>> make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1
>> make[1]: *** [prepare0] Error 2
>> make: *** [__sub-make] Error 2
>>
> 
> Fixed by moving TASK_SIZE_MAX into asm/task_size_32.h and
> asm/task_size_64.h
> 
> diff --git a/arch/powerpc/include/asm/task_size_32.h
> b/arch/powerpc/include/asm/task_size_32.h
> index de7290ee770f..03af9e6bb5cd 100644
> --- a/arch/powerpc/include/asm/task_size_32.h
> +++ b/arch/powerpc/include/asm/task_size_32.h
> @@ -7,6 +7,7 @@
>  #endif
> 
>  #define TASK_SIZE (CONFIG_TASK_SIZE)
> +#define TASK_SIZE_MAX        TASK_SIZE
> 
>  /*
>   * This decides where the kernel will search for a free chunk of vm
> space during
> diff --git a/arch/powerpc/include/asm/task_size_64.h
> b/arch/powerpc/include/asm/task_size_64.h
> index c993482237ed..bfdb98c0ef43 100644
> --- a/arch/powerpc/include/asm/task_size_64.h
> +++ b/arch/powerpc/include/asm/task_size_64.h
> @@ -49,6 +49,7 @@
>                          TASK_SIZE_USER64)
> 
>  #define TASK_SIZE TASK_SIZE_OF(current)
> +#define TASK_SIZE_MAX        TASK_SIZE_USER64
> 
>  #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4))
>  #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(DEFAULT_MAP_WINDOW_USER64
> / 4))
> diff --git a/arch/powerpc/include/asm/uaccess.h
> b/arch/powerpc/include/asm/uaccess.h
> index 22c79ab40006..5823140d39f1 100644
> --- a/arch/powerpc/include/asm/uaccess.h
> +++ b/arch/powerpc/include/asm/uaccess.h
> @@ -8,13 +8,6 @@
>  #include <asm/extable.h>
>  #include <asm/kup.h>
> 
> -#ifdef __powerpc64__
> -/* We use TASK_SIZE_USER64 as TASK_SIZE is not constant */
> -#define TASK_SIZE_MAX        TASK_SIZE_USER64
> -#else
> -#define TASK_SIZE_MAX        TASK_SIZE
> -#endif
> -
>  static inline bool __access_ok(unsigned long addr, unsigned long size)
>  {
>      return addr < TASK_SIZE_MAX && size <= TASK_SIZE_MAX - addr;


Thanks, that's very helpful!

-- 
          Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ