Re: [PATCH 1/4] parisc: Drop strnlen_user() in favour of generic version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 8, 2021 at 10:44 PM Helge Deller <deller@xxxxxx> wrote:
>
> As suggested by Arnd Bergmann, drop the parisc version of
> strnlen_user() and switch to the generic version.

The strnlen_user() removal looks good,

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>

> user_addr_max() was wrong too, fix it by using TASK_SIZE.

Not sure about this part though:

>  /*
>   * Complex access routines -- macros
>   */
> -#define user_addr_max() (~0UL)
> +#define user_addr_max() (uaccess_kernel() ? ~0UL : TASK_SIZE)

We are getting very close to completely removing set_fs()/get_fs(),
uaccess_kernel() and some related bits from the kernel, so I think
it would be better to the other way here and finish off removing
CONFIG_SET_FS from parisc.

I think this will also simplify your asm/uaccess.h a lot, in particular
since it has separate address spaces for __get_user() and
__get_kernel_nofault(), and without set_fs() you can leave out
the runtime conditional to switch between them.

       Arnd



[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux